|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-03-11 09:17 UTC] php at bof dot de
Description: ------------ Dear PHP security folks, I'm investigating https://bugs.php.net/bug.php?id=68486 at the moment, and now think that it has the potential of resulting in remote code execution (at the machine code level, not PHP code level). The issue is with Apache 2.4, the PHP apache2handler SAPI, and pipelined HTTP requests. Given a simple (just a single echo) PHP script http://example.com/foo the following results in segfaults, but not always: echo -e "GET /foo HTTP/1.1\nHost: example.com\n\nGET /foo HTTP/1.1\nHost: example.com\n\n" | netcat localhost 80 This is because after the first request, the interpreter is deinitialized (sapi_apache2.c line 679 calls php_apache_request_dtor), BUT contrary to the situation under Apache 2.2, Apache 2.4 does NOT call the pool cleanup function (php_server_context_cleanup) before the second request is processed - resulting in SG(server_context) still being non-NULL, which then makes the second request being handled as a subrequest (parent_req != NULL), skipping the call to php_apache_request_ctor - thus running the request in a deconfigured interpreter. Sometimes this leads to SEGV, sometimes it does not, which makes me fear this has the potential for RCE. I'm not a security researcher, just a lowly sysadmin, so I will not investigate exploitation potential further - but maybe you could? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Hello? Anybody? I the original bug report, and on internals, we now have several positive reproducers for this issue. I worked on a fix, also see the original report. From everything I understand so far: EVERY apache2handler based Apache 2.4 ON THIS PLANET CAN BE MADE TO DUMP CORE or worse, AT WILL, WITH AN EASY DOUBLE-HTTP/1.1 REQUEST. I will continue to work on my patch in the original report, without stressing the security implications too much; tomorrow I'll see that I can run my patched 5.6.7RC1 with our full production load, and will give feedback then. Apart from that, I cannot invest much more time on this, especially without further guidance regarding several use case issues I don't understand with the current handler code. Please also refer to these two internals list threads regarding discussion, reproductions, and open questions and issues: SAPI apache2handler + pipelined HTTP request core dumps and, started today on a related topic PHP apache2handler virtual() function Please tell, how would you like to proceed with this issue?