![]() |
Login | Packages | Support | Bugs |
| Documentation: Downloads: |
[2008-03-17 16:43 UTC] Daniel dot Papasian at chronicle dot com
[2008-03-17 17:12 UTC] Daniel dot Papasian at chronicle dot com
APC configuration: apc.include_once_override=1 apc.shm_size=64 apc.gc_ttl=3600 apc.ttl=0 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.filters= apc.stat=1 apc.enable_cli=1 php -v information: PHP 5.2.5 (cli) (built: Dec 18 2007 13:37:09) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies Apache information (but I've repeated on more than one version): Server version: Apache/2.2.4 (FreeBSD) Server built: Jun 4 2007 11:13:32 [2008-03-17 21:05 UTC] rasmus at php dot net
In your patch you change the copy from path_for_open to filename? [2008-03-17 21:17 UTC] Daniel dot Papasian at chronicle dot com
Nope, although I admit that I had that faulty patch up there for a bit -- it's been fixed, however. I was merging from an earlier version of APC (where I found and fixed the version first, before forward-porting to CVS) where the second argument was filename, and missed it in the diff. The patch should be right now. The only thing changed was going from strcpy to strncpy and adding a bound: http://papasian.org/~dannyp/apc.patch.dpapasian [2008-03-17 21:23 UTC] Daniel dot Papasian at chronicle dot com
And I should point out that my patch is probably not the most correct. There should probably be an effort to terminate the string if it's overflowing, or do something else that's smarter -- not knowing the code too well, it's hard to say the proper way. Here is another patch. I'm also dropping some of the extra parentheses around the size argument. This patch should ensure that the string is always terminated. http://papasian.org/~dannyp/apc.dpapasian.patch2 [2008-03-22 23:46 UTC] Daniel dot Papasian at chronicle dot com
I've written a more advanced proof of concept that uses the buffer overflow to actually execute code, instead of merely crash: http://papasian.org/~dannyp/apcsmash.php.txt It's still not the easiest thing to exploit because, on Linux at least, apc seems to be loaded into different parts of memory each time apache starts. A committed attacker could simply brute force it, however, segfaulting a bunch of apache children until the sweet spot is found and the reverse shell opened. [2008-03-25 05:23 UTC] Daniel dot Papasian at chronicle dot com
This bug is referenced in CVE-2008-1488 http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-1488 [2008-03-25 05:43 UTC] rasmus at php dot net
Fixed in CVS. We use strlcpy for this. 3.0.17 will be out shortly. |
||||||||||||||||||||||
|
PRIVACY POLICY | CREDITS |
|
|
Copyright © 2001-2008 The PHP Group All rights reserved. |
Last updated: Fri Aug 07 10:22:05 2009 UTC Bandwidth and hardware provided by: pair Networks |