Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 97547 - sys-libs/zlib: deflate vulnerability (CAN-2005-2096)
Summary: sys-libs/zlib: deflate vulnerability (CAN-2005-2096)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Security
URL: http://dev.gentoo.org/~taviso/files/z...
Whiteboard: A1 [glsa]
Keywords:
Depends on:
Blocks: 98121
  Show dependency tree
 
Reported: 2005-06-30 14:18 UTC by Tavis Ormandy (RETIRED)
Modified: 2007-08-16 18:36 UTC (History)
8 users (show)

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


Attachments
testcase 1 (zlib.cgi.gz,162 bytes, application/octet-stream)
2005-06-30 14:19 UTC, Tavis Ormandy (RETIRED)
no flags Details
testcase 2 (png) (image.png,102 bytes, image/png)
2005-06-30 14:20 UTC, Tavis Ormandy (RETIRED)
no flags Details
testcase 1 (cgi script) (zlib.cgi.gz,178 bytes, application/octet-stream)
2005-07-01 02:39 UTC, Tavis Ormandy (RETIRED)
no flags Details
testcase 3 (.gz) (testcase.gz,39 bytes, application/octet-stream)
2005-07-01 04:09 UTC, Tavis Ormandy (RETIRED)
no flags Details
proposed patch (zlib.diff,759 bytes, patch)
2005-07-02 05:19 UTC, Tavis Ormandy (RETIRED)
no flags Details | Diff
zlib-1.2.2-r1.ebuild (zlib-1.2.2-r1.ebuild,1.82 KB, text/plain)
2005-07-02 06:18 UTC, solar (RETIRED)
no flags Details
zlib-1.2.2-inftrees.patch (zlib-1.2.2-inftrees.patch,474 bytes, patch)
2005-07-02 06:20 UTC, solar (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tavis Ormandy (RETIRED) gentoo-dev 2005-06-30 14:18:23 UTC
I've discovered a data stream that causes zlib to corrupt an data structure, resulting in the linked application dumping core.

Upstream contacted, but no reponse, awaiting vendor-sec to suggest alternate contact address. (note this is totally unrelated to bug 94584 )
Comment 1 Tavis Ormandy (RETIRED) gentoo-dev 2005-06-30 14:19:47 UTC
Created attachment 62357 [details]
testcase 1

sh cgi script that crashes opera/firefox by sending content-encoding: gzip.
Comment 2 Tavis Ormandy (RETIRED) gentoo-dev 2005-06-30 14:20:56 UTC
Created attachment 62358 [details]
testcase 2 (png)

png file with a specially crafted IDAT chunk.
Comment 3 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-01 02:39:43 UTC
Created attachment 62386 [details]
testcase 1 (cgi script)

This should crash any web browser that uses zlib to handle gzip content
encoding. confirmed with dillo, firefox, opera, mozilla.
Comment 4 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-01 04:09:21 UTC
Created attachment 62396 [details]
testcase 3 (.gz)

specially crafted gzip file that should crash application using gzread()

$ display testcase.gz
Segmentation fault
$ clamscan testcase.gz
Segmentation fault
...etc.

$ MALLOC_CHECK_=1 identify testcase.gz 
malloc: using debugging hooks
*** glibc detected *** malloc: top chunk is corrupt: 0x08075840 ***
*** glibc detected *** free(): invalid pointer: 0x08073c78 ***
Segmentation fault

This looks like it could be exploitable to me, perhaps via sshd and corrupt
chunks of deflated data (although UsePrivilegeSeperation should stop it being
useful) or via web browser, emailed images, and so on.
Comment 5 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-02 02:06:14 UTC
Contacted Mark Adler, co-author of zlib who says he has forwarded my report to 
the developers mailing list for investigation.
Comment 6 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-02 05:19:55 UTC
Created attachment 62457 [details, diff]
proposed patch

Mark Adler proposed the attached patch
Comment 7 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-07-02 05:24:33 UTC
Vapier/Solar please advise/provide an updated ebuild. 
Comment 8 solar (RETIRED) gentoo-dev 2005-07-02 06:18:52 UTC
Created attachment 62463 [details]
zlib-1.2.2-r1.ebuild
Comment 9 solar (RETIRED) gentoo-dev 2005-07-02 06:20:36 UTC
Created attachment 62464 [details, diff]
zlib-1.2.2-inftrees.patch

Updated patch using diff -u to go along with the updated ebuild
Comment 10 solar (RETIRED) gentoo-dev 2005-07-02 06:26:40 UTC
Due to the nature of this and the testcases, please lets aim for getting this one 
out on or by Wend Jul 6th
Comment 11 SpanKY gentoo-dev 2005-07-02 07:02:06 UTC
ive got local zlib ebuilds/patches ready to go ...
Comment 12 solar (RETIRED) gentoo-dev 2005-07-02 08:27:14 UTC
Adding a selected member of releng (kugelfang) to make sure that any 
snapshots are not taken before the final release day.

kugelfang: this is still a confidential bug. 
If you could relay that fact a pretty critcial package bug is about to be fixed 
without sharing too may details to the rest of releng other than it being a core 
system package we would be thankful.
Comment 13 solar (RETIRED) gentoo-dev 2005-07-02 08:30:33 UTC
Anybody here can request CAN assignment please? (jaervosz || taviso)
Comment 14 Danny van Dyk (RETIRED) gentoo-dev 2005-07-02 08:38:23 UTC
Just talked with plasmaroo. Resnapshotting is no problem, we're still in
prerelease phase. Thanks for letting us know!
Comment 15 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-02 08:51:48 UTC
zlib author informs me CERT has been notified.
Comment 16 solar (RETIRED) gentoo-dev 2005-07-02 13:23:13 UTC
Colin Percival requested a CVE.
Comment 17 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-03 00:32:23 UTC
this is CAN-2005-2096
Comment 18 Thierry Carrez (RETIRED) gentoo-dev 2005-07-03 02:00:01 UTC
Could be exploitable, raising rating.
Comment 19 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-07-03 23:29:09 UTC
Arch Security liaisons, please test zlib 1.2.2-r1 and report back on this bug. 
Do NOT commit anything to Portage. 
Comment 20 Markus Rothe (RETIRED) gentoo-dev 2005-07-04 05:18:12 UTC
I get this on ppc64:

$ display image.png
display: Corrupt image `image.png`.
$ 

I think that this correct, so ppc64 could go stable.
Comment 21 Gustavo Zacarias (RETIRED) gentoo-dev 2005-07-04 06:31:51 UTC
Looks sane on sparc.
Comment 22 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-07-04 11:43:52 UTC
Looks good on ppc. Adding KillerFox to CC for testing on hppa (I'm working with
him to test it).

Other than that, why do we have to test such simple patches? Everyone who
understands a bit of C knows that this code won't break on another architecture.
So testing it on one or two would be enough. I know it's policy and such, but
that's just what I think.
Comment 23 René Nussbaumer (RETIRED) gentoo-dev 2005-07-04 12:28:36 UTC
Looks good on hppa.
Comment 24 Danny van Dyk (RETIRED) gentoo-dev 2005-07-04 12:44:04 UTC
Fine for amd64. gunzip didn't vomit on testcase_3.gz :-)
Comment 25 Tavis Ormandy (RETIRED) gentoo-dev 2005-07-06 07:01:39 UTC
This is public at 1400UTC today.
Comment 26 Thierry Carrez (RETIRED) gentoo-dev 2005-07-06 07:27:48 UTC
Public followup on bug 98121
GLSA 200507-05