integer overflow to heap overrun exploit in glibc

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

integer overflow to heap overrun exploit in glibc

Jeff Law
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As y'all may be aware, there's an integer overflow which can be used
to trigger a heap overrun/corruption in time/tzfile.c

http://dividead.wordpress.com/2009/06/01/glibc-timezone-integer-overflow/


http://rcvalle.com/post/14169476482/exploiting-glibc-tzfile-read-integer-overflow-to


I'm not terribly familiar with the code in question, but ISTM we have
to verify the intermediate computations to determine the amount of
memory to malloc don't overflow/wrap.

Here's a WIP.  It catches the cases I've been made aware of
(overflowing total_size to 0 by creating a tzfile with a very large
tzh_charcnt).  But there may be further overflows I've missed.

Obviously it's not commented and it's unclear to me if we also want to
put in some kind of sanity checks on total_size to prevent it from
trying to malloc unreasoanble amounts of memory.

Your feedback would be greatly appreciated.




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO6k6gAAoJEBRtltQi2kC7ASQH/0UmQm0wqk3NRmlsVr5M1r3f
fUelY55y8OQssaFCLDZ9LX1vybam9j85gmvGtRJUU4MJ3134hn/v73k8TYCd3rHJ
/QIQY10zPBHkmEwp8G56+3l9QRl418C+ajTq0W4NAzM1rIHtPUgrqZ3AkNJgFVYU
OAF+2afFDGE5vJ3HR7LSL62tuxjDf7m66r4tHHkbhkSSZgkyW/YxfFUPDupZnlz8
Wl87JU/RWHdMJ+RR+fB1ofgFKrNZnGpIsD3sAc07KWTp63S358DSRpZ1IaF2o3vh
N93z28eCQQKIVciOKgAE5q/qYr1KmcyU/6M4xPk+Pqv5YFdKOz8uNiw5NQu2rv0=
=RKgA
-----END PGP SIGNATURE-----

glibc-rh767696.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: integer overflow to heap overrun exploit in glibc

Roland McGrath-4
I haven't looked at that code in a long time and haven't considered this
issue yet.  But it sure seems like a bugzilla item would make sense for this.


Thanks,
Roland
Reply | Threaded
Open this post in threaded view
|

Re: integer overflow to heap overrun exploit in glibc

Paul Eggert
On 12/15/11 11:50, Roland McGrath wrote:
> it sure seems like a bugzilla item would make sense for this.

I opened Bug#13506 and will follow up there.

http://sourceware.org/bugzilla/show_bug.cgi?id=13506
Reply | Threaded
Open this post in threaded view
|

Re: integer overflow to heap overrun exploit in glibc

Roland McGrath-4
> I opened Bug#13506 and will follow up there.

I didn't mean to suggest that this list wasn't a good place to discuss the
details of the code--it is the best place for that.  Just that we should
have the bug report filed for keeping track.


Thanks,
Roland