Menu

#474 ar(1) directory traversal

1.0
closed
nobody
None
Fixed
2015-02-24
2015-01-04
No

ar(1) has a directory traversal vulnerability -- it seems not to check extracted filenames at all:

:::text
$ printf '!<arch>\n%-48s%-10s`\n%-48s%-10s`\n' /tmp/file 0 ../file 0 > test.a
$ ./ar -xv test.a
x - /tmp/file
x - ../file

It's usually agreed that unpackers and similar tools should not by default touch files outside the working directory. The danger is in overwriting sensitive files by an unconscious user or by an automatic process. Both absolute and relative paths are dangerous.

For similar examples please see https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-4131 (tar), https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4651 (patch). And I recently reported the same problem in binutils: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-8737 .

Discussion

  • Ed Maste

    Ed Maste - 2015-02-24
    • status: new --> closed
    • Milestone: 2.0 --> 1.0
    • Resolution: --> Fixed
     
  • Ed Maste

    Ed Maste - 2015-02-24

    Fixed in [r3169]

     

    Related

    Commit: [r3169]


    Last edit: Ed Maste 2015-02-24

Log in to post a comment.