From:
Operating system: linux
PHP version: Irrelevant
Package: Apache2 related
Bug Type: Bug
Bug description:Incomplete POST does not timeout but is passed to PHP
Description:
------------
When a user has a really slow connection (we experienced the problem with
POSTs
longer than single TCP/IP frame) it may happen, that in expected amount of
time
the number of POST body bytes transmited is less than announced in
Content-Length
header.
It seems, that even with the mod_reqtimeout installed and configured,
apache2
happilly passes the request to PHP interpreter, with $_POST set to an empty
array.
It does so if the reqeusted page is a PHP script, which is inconsistent
with the
way a static HTML file is handled (400 Bad Request).
Test script:
---------------
I assume you have a script with var_dump($_POST) on the server.
Please note how 1755 is much greater than "foo=bar" length
netcat localhost 80
POST / HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 1755
foo=bar
Expected result:
----------------
408 Request Timeout
or
504 Gateway Timeout
or
400 Bad Request
or in the worst case
200 OK
array(1){
"foo" => "bar"
}
Actual result:
--------------
200 OK
array(0){
}
--
Edit bug report at https://bugs.php.net/bug.php?id=61471&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61471&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61471&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61471&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61471&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61471&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61471&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61471&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61471&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61471&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61471&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61471&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61471&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61471&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61471&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61471&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61471&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61471&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61471&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61471&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61471&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61471&r=mysqlcfg