Bug 280961 (CVE-2007-4476)

Summary: CVE-2007-4476 tar/cpio stack crashing in safer_name_suffix
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: kreilly, mcermak, mjc, ovasik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-4476
Whiteboard: source=cve,reported=20070904,public=20070817,impact=low,cvss2=2.6/AV:N/AC:H/Au:N/C:N/I:N/A:P
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-16 03:37:23 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 339681, 339691, 363881, 363891, 568023, 568024, 568025, 568026, 568068, 568069, 826654    
Bug Blocks:    
Attachments:
Description Flags
patch for cpio-2.6
none
new patch for cpio-2.6 (this one frees malloc'd memory) none

Description Tomas Hoger 2007-09-06 13:01:45 EDT
Common Vulnerabilities and Exposures assigned an identifier CVE-2007-4476
to the following vulnerability:

Bug in the safer_name_suffix function in GNU tar may lead to a "crashing
stack".  It can be used to crash tar while extracting archive containing file
with long name containing unsafe prefix.

Affected function is also part of cpio source code.

References:

http://www.novell.com/linux/security/advisories/2007_18_sr.html
http://lists.gnu.org/archive/html/bug-cpio/2007-08/msg00002.html
Comment 1 Tomas Hoger 2007-09-06 13:05:50 EDT
Upstream patch for paxutils / paxlib (used by recent versions of tar and cpio):

http://cvs.savannah.gnu.org/viewvc/paxutils/paxutils/paxlib/names.c?r1=1.2&r2=1.4
Comment 7 Radek Brich 2007-10-24 11:35:04 EDT
Created attachment 236281 [details]
patch for cpio-2.6

this patch should work for all affected software as the rest of patch from
comment #1 are just optimizations for memory usage (one malloc less)
Comment 8 Radek Brich 2007-10-24 11:40:00 EDT
Fedora builds of fixed tar are now complete (with the patch from upstream):
  tar-1.15.1-27.fc6
  tar-1.15.1-28.fc7
  tar-1.17-4.fc8
  tar-1.17-4.fc9
Comment 11 Fedora Update System 2007-10-29 15:02:36 EDT
tar-1.15.1-28.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 Radek Brich 2007-11-01 14:43:20 EDT
Created attachment 245931 [details]
new patch for cpio-2.6 (this one frees malloc'd memory)
Comment 16 Radek Brich 2007-11-02 09:44:11 EDT
fixed Fedora builds of cpio:
  cpio-2.6-22.fc6
  cpio-2.6-28.fc7
  cpio-2.9-5.fc8
  cpio-2.9-5.fc9
Comment 18 Fedora Update System 2007-11-05 10:06:18 EST
cpio-2.6-28.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 19 Fedora Update System 2007-11-06 11:05:52 EST
tar-1.17-4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Fedora Update System 2007-11-06 11:08:27 EST
cpio-2.9-5.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 25 errata-xmlrpc 2010-03-15 19:55:40 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4
  Red Hat Enterprise Linux 5

Via RHSA-2010:0141 https://rhn.redhat.com/errata/RHSA-2010-0141.html
Comment 26 errata-xmlrpc 2010-03-15 21:15:30 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

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