Bug #68745 [NEW]: Invalid HTTP requests make web server segfault
| From: | benjamin dot morel at gmail dot com | Date: | Mon, 05 Jan 2015 00:12:22 +0000 |
| Subject: | Bug #68745 [NEW]: Invalid HTTP requests make web server segfault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-189651@lists.php.net to get a copy of this message | ||
From: benjamin dot morel at gmail dot com
Operating system: Fedora 21
PHP version: 5.6.4
Package: Built-in web server
Bug Type: Bug
Bug description:Invalid HTTP requests make web server segfault
Description:
------------
I'm not sure whether this is a bug in the web server or in PHP itself,
but trying to access $_SERVER when PHP has received an invalid request
such as:
GET www.example.com:80 HTTP/1.1
Makes the built-in web server segfault.
Test script:
---------------
1. Create a test.php file containing this line:
<?php print_r($_SERVER);
2. Start the built-in web server on this file:
php -S localhost:8888 test.php
3. Run this PHP code to send an invalid HTTP request:
$fp = fsockopen('localhost', 8888);
fwrite($fp, "GET www.example.com:80 HTTP/1.1\r\n\r\n");
while (! feof($fp)) echo fread($fp, 1024);
fclose($fp);
The web server will segfault.
--
Edit bug report at https://bugs.php.net/bug.php?id=68745&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68745&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68745&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68745&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68745&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68745&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68745&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68745&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68745&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68745&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68745&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68745&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68745&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68745&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68745&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68745&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68745&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68745&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68745&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68745&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68745&r=mysqlcfg