Bug 1018150 (CVE-2013-4420) - CVE-2013-4420 libtar: missing validation of file names
Summary: CVE-2013-4420 libtar: missing validation of file names
Alias: CVE-2013-4420
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1018151 1018152 1018153 1018154
Blocks: 1018329
TreeView+ depends on / blocked
Reported: 2013-10-11 10:48 UTC by Ratul Gupta
Modified: 2021-06-16 15:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2021-06-16 15:03:58 UTC

Attachments (Terms of Use)

Description Ratul Gupta 2013-10-11 10:48:19 UTC
libtar was found to have a flaw where it does not validate the file names stored inside a tar file, which could possibly lead to a file extraction outside the prefix path.

The functions "tar_extract_glob" and "tar_extract_all" accept a path prefix on where to extract files to, but libtar doesn't validate the file names inside the tar file. For example: consider a file name "../../etc/passwd". If extract_all is called with prefix "/home/USER/", libtar would try to overwrite "/etc/passwd".

There is a workaround where a user could validate all filenames inside tar archive before calling tar_extract_*, but it seems that most of the users don't do that, so it's better that libtar should itself validate the file names.


Comment 2 Ratul Gupta 2013-10-11 10:51:43 UTC
Created libtar tracking bugs for this issue:

Affects: fedora-all [bug 1018151]
Affects: epel-5 [bug 1018152]

Comment 3 Huzaifa S. Sidhpurwala 2013-10-16 05:41:39 UTC

This issue affects the version of libtar as shipped with Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this issue as having low security impact, a future update may address this flaw.

Comment 6 Product Security DevOps Team 2021-06-16 15:03:58 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


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