Bug 295021 - (CVE-2007-4829) CVE-2007-4829 perl-Archive-Tar directory traversal flaws
CVE-2007-4829 perl-Archive-Tar directory traversal flaws
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
: Security
: 514322 (view as bug list)
Depends On: 315321 315331 364281 364291 430738 430739 430740 595731 595732 595733 595734 833952
  Show dependency treegraph
Reported: 2007-09-18 12:18 EDT by Tomas Hoger
Modified: 2012-06-20 10:28 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 514322 (view as bug list)
Last Closed: 2010-07-01 16:50:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tomas Hoger 2007-09-18 12:18:42 EDT
Directory traversal vulnerability in Archive::Tar perl module allows
user-assisted remote attackers to overwrite arbitrary files writable by user
running application using this module via an absolute path or a .. (dot dot)
sequence in filenames in a TAR archive.

Similar issues were reported and fixed for GNU tar during past several years,
e.g.: CVE-2001-1267, CVE-2002-0399, CVE-2002-1216 and CVE-2007-4131.

This issue is important when this module is used to extract tar archives from
untrusted sources.  However, some of such applications either implement
workarounds / own checks (sa-update in spamassassin) or dropped module support
at all (amavisd-new).
Comment 1 Tomas Hoger 2007-09-18 12:20:50 EDT
Similar issue was reported for Python's tarfile module, see #263261.
Comment 2 Tomas Hoger 2007-09-24 14:30:12 EDT
Upstream bug report:

Comment 5 Lubomir Kundrak 2007-11-09 12:49:41 EST
Is there any chance this will get addressed for fedora?
Comment 6 Robin Norwood 2007-11-09 13:23:19 EST
Once we have a fix for it, that fix will go into all supported versions of
fedora ASAP.  We don't have a fix yet, though.
Comment 8 Jan Pazdziora 2008-03-05 09:25:11 EST
The Archive::Tar 1.38 is now available on CPAN, with the following in CHANGES:

* important changes in vesrion 1.38    14/12/2007:
- Promote 1.37_01 to stable.

* important changes in version 1.37_01 11/11/2007:
_ Address #30380: directory traversal vulnerability in Archive-Tar
  - Add $INSECURE_EXTRACT_MODE which defaults to 0, disallowing
    archives to extract files outside of cwd(). This is a backwards
    incompatible change from 1.36 and before.
  - Add a -I option to ptar to enable insecure extraction if needed

So using this version in Fedoras seems like a way to to go. The diff from 1.34
(which we have in F8 and rawhide) and 1.36 is VMS specific, and diff from 1.36
to 1.38 is exactly fix for this bugzilla, so it should be safe to rebase.

Hmmm. Should I put this note to release-specific bugzillas?
Comment 9 Tomas Hoger 2008-03-05 10:53:28 EST
Sadly, upstream version 1.38 is still prone to the directory traversal attack
using symlinks, as described in old Willy Tarreau's BugTraq post:


That problem was already pointed out in the upstream bug report.
Comment 10 Jan Pazdziora 2008-03-05 11:03:49 EST
You are right. I should have said "diff from 1.36 to 1.38 is a partial fix for
this bugzilla and not other changes".

Is it better to wait for definitive fix, or close that one hole that 1.38
addresses, for the time being?
Comment 11 Miroslav Suchý 2008-03-19 09:46:10 EDT
Comment 12 Lubomir Kundrak 2008-04-04 11:56:17 EDT
Maintainers; could you please punch upstream about this a bit? In case not, what
about applying Mirek's patch referred to in comment $11?
Comment 13 Tomas Hoger 2008-04-07 06:02:10 EDT
(In reply to comment #12)
> Maintainers; could you please punch upstream about this a bit? In case not, what
> about applying Mirek's patch referred to in comment $11?

Sorry, Mirek's patch does not resolve the issue.
Comment 15 Tuomo Soini 2008-12-11 01:14:20 EST
This should now be fixed upstream.
Comment 16 Tomas Hoger 2008-12-11 03:50:55 EST
1.40 does following to cover known vectors:

- absolute paths are rejected
- all paths that include '..' as one of the elements are rejected
- extracting to symlink directories is denied

(applies to default SECURE EXTRACT MODE)

perl-Archive-Tar is now core perl module (as of perl 5.10 / F9, iirc), so Fedora updates will have to go via perl update.
Comment 17 Tuomo Soini 2008-12-11 05:17:12 EST
rhel5 is still vulnerable...
Comment 18 Fedora Update System 2008-12-22 08:25:02 EST
perl-5.10.0-52.fc10 has been submitted as an update for Fedora 10.
Comment 19 Fedora Update System 2008-12-30 18:44:35 EST
perl-5.10.0-52.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Vincent Danen 2009-07-28 21:27:33 EDT
*** Bug 514322 has been marked as a duplicate of this bug. ***
Comment 21 Tuomo Soini 2010-03-31 03:26:14 EDT
I'd like to point out that perl-Archive-Tar-1.30-1.fc6 which is in rhel5 is still vulnerable as of rhel-5.5.
Comment 22 Vincent Danen 2010-04-06 10:53:10 EDT
We had provided an NVD statement for this regarding Red Hat Enterprise Linux 5:


It should have been noted here as well, however.

The Red Hat Security Response Team does not consider this bug to be a security issue. It is not suggested behavior to extract archives from untrusted sources without prior inspection of the archive contents.
Comment 32 Tomas Hoger 2010-05-25 09:32:42 EDT
Raising priority here to make sure perl-Archive-Tar versions in RHEL4 and RHEL5 are update to address this issue.

This flaw in perl-Archive-Tar did not affect other components shipped in RHEL using this perl module, as extract() method is not used.

It should also be noted that update Archive::Tar may fail to extract certain non-standard, but non-malicious archives that use one of the restricted paths or links (see comment #16), but don't attempt to leave current working directory during the archive extraction.
Comment 39 errata-xmlrpc 2010-07-01 14:58:40 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 4

Via RHSA-2010:0505 https://rhn.redhat.com/errata/RHSA-2010-0505.html

Note You need to log in before you can comment on or make changes to this bug.