Bug 1018150 (CVE-2013-4420)

Summary: CVE-2013-4420 libtar: missing validation of file names
Product: [Other] Security Response Reporter: Ratul Gupta <ratulg>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: carnil, huzaifas, kdudka, praiskup
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-16 15:03:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1018151, 1018152, 1018153, 1018154    
Bug Blocks: 1018329    

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.

References:
http://seclists.org/oss-sec/2013/q4/69
https://lists.feep.net:8080/pipermail/libtar/2013-October/000362.html

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
Statement:

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):

https://access.redhat.com/security/cve/cve-2013-4420