Bug 183426

Summary: Buffer overflow during archive creation
Product: [Fedora] Fedora Reporter: Josh Bressers <bressers>
Component: zooAssignee: Nicolas Mailhot <nicolas.mailhot>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: extras-qa
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: 2006-03-05 16:14:08 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:

Description Josh Bressers 2006-02-28 23:21:44 UTC
A buffer overflow bug exists in zoo which is triggered during archive creation.
 This issue is borderline a bug as it's really only a problem if someone is
creating a zoo archive on a directory full of files controlled by a local attacker.

Here is how to reproduce this issue:

mkdir `perl -e 'print "A"x254'`
cd `perl -e 'print "A"x254'`
mkdir `perl -e 'print "A"x254'`
cd `perl -e 'print "A"x254'`
touch feh
cd ../..
zoo a arch.zoo `perl -e 'print "A"x254 . "/" . "A"x254 . "/feh"'`


To fix this issue, in parse.c, line 42, Change the line:

strcpy (tempname, fname);

to

strncpy(tempname, fname, LFNAMESIZE);

Please note that there are probably countless other issues similar to this in
zoo.  I've not looked for any of them.

Comment 1 Nicolas Mailhot 2006-02-28 23:55:53 UTC
This is a dupe of #183109
I take it you prefer your fix to the one proposed there ? (just making sure)

*** This bug has been marked as a duplicate of 183109 ***

Comment 2 Josh Bressers 2006-02-28 23:59:02 UTC
These are two different issues.

Comment 3 Nicolas Mailhot 2006-03-04 13:33:45 UTC
I couldn't reproduce it with the current fe zoo
I'm pushing a new fe zoo (zoo-2.10-7) using the opensuse package as base (seems
a bit cleaner than ours) and your fix
Please check the result is ok with you

Comment 4 Josh Bressers 2006-03-05 16:14:08 UTC
I no longer see this behavior in the latest update from -devel (zoo-2.10-8.fc5)

If you've not done so, you may want to alert the other distributions and
upstream about this issue (I'm not sure if there is still an upstream though).