You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2009/09/24 12:49:08 UTC

DO NOT REPLY [Bug 47895] New: Incorrect 413 error handling

https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

           Summary: Incorrect 413 error handling
           Product: Apache httpd-2
           Version: 2.2.11
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: michkol@gmail.com


Apache incorrectly sends the file content after sending 413 error message, for
example:

POST /robots.txt HTTP/1.0
Content-Length: -75000000

HTTP/1.1 413 Request Entity Too Large
Date: Thu, 24 Sep 2009 10:42:30 GMT
Server: Apache/2.2.11 (Unix)
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/robots.txt<br />
does not allow request data with POST requests, or the amount of data provided
in
the request exceeds the capacity limit.
</body></html>
User-agent: *
Disallow: /d2/
Crawl-delay: 1

Apache should close the connection after sending </html> but it doesn't.

It's a big problem when PHP scripts are requested with a wrong Content-Length
because the source code is sent to a client after the error message:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/test.php<br />
does not allow request data with POST requests, or the amount of data
provided in
the request exceeds the capacity limit.
</body></html>
<?php
$dblogin = 'admin';
$dbpass = 'secret';
mysql_connect('localhost', $dblogin, $dbpass);
echo 'some output';
?>

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

michkol@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from michkol@gmail.com 2010-01-16 02:33:05 UTC ---
Without mod_php, the error message is also incorrect:

POST /forum/index.php HTTP/1.0
Host: centrump2p.com
Content-Length: -5000

HTTP/1.1 413 Request Entity Too Large
Date: Sat, 16 Jan 2010 10:25:44 GMT
Server: Apache
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/php5-cgi/forum/index.php<br />
does not allow request data with POST requests, or the amount of data provided
in
the request exceeds the capacity limit.
</body></html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 michkol@gmail.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<p>Additionally, a 500 Internal Server Error
error was encountered while trying to use an ErrorDocument to handle the
request.</p>
</body></html>

Server configuration: http://colin.az.pl/config.html. No third-party modules
are loaded.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Nick Kew <ni...@webthing.com> 2010-01-24 13:32:26 UTC ---
(In reply to comment #2)
> Without mod_php, the error message is also incorrect:

Are you sure that's without mod_php?  You've got mod_php configured (though
using AddType, which lives on in undeath since it ceased to be the right thing
with Apache 1.1.0 back in about 1996).

> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>413 Request Entity Too Large</title>
> </head><body>
> <h1>Request Entity Too Large</h1>
> The requested resource<br />/php5-cgi/forum/index.php<br />
> does not allow request data with POST requests, or the amount of data provided
> in
> the request exceeds the capacity limit.
> </body></html>

Where does that come from?  Apache's canned 413 response should have slightly
different body text:

    The <!--#echo var="REDIRECT_REQUEST_METHOD" -->
    method does not allow the data transmitted, or the data volume
    exceeds the capacity limit.

Yours seems to me the better text, if we ignore the continuation (which rings a
bell: I thought the double-errordocument was a bug we'd fixed).

> Server configuration: http://colin.az.pl/config.html. No third-party modules
> are loaded.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

michkol@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Linux                       |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

--- Comment #5 from michkol@gmail.com 2010-01-24 14:47:26 UTC ---
I can reproduce this bug on your server:
POST / HTTP/1.0
Host: webthing.com
Content-Length: -10000000

HTTP/1.1 413 Request Entity Too Large
Date: Sun, 24 Jan 2010 22:41:50 GMT
Server: Apache/2.2.9 (Unix) DAV/2 SVN/1.4.6
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/index.html<br />
does not allow request data with POST requests, or the amount of data provided
in
the request exceeds the capacity limit.
<hr>
<address>Apache/2.2.9 (Unix) DAV/2 SVN/1.4.6 Server at webthing.com Port
80</address>
</body></html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 webthing@webthing.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.9 (Unix) DAV/2 SVN/1.4.6 Server at webthing.com Port
80</address>
</body></html>

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

--- Comment #6 from Nick Kew <ni...@webthing.com> 2010-01-24 18:58:42 UTC ---
It's a fair cop, guv.

I'm sure we fixed a similar bug a while back, but you seem to have found
another.  Bug me if I let this drop now you've provided the reproducible test
case!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Kew <ni...@webthing.com> 2009-11-01 11:03:30 UTC ---
I can't reproduce this, which leads me to suspect something in your
configuration, or PHP.  What happens without mod_php loaded?  Do you have
mod_cache loaded?

If you can reproduce it with no third-party modules loaded, please upload a
minimal config to demonstrate it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

--- Comment #7 from maapu <ka...@gmail.com> ---
I am facing this bug now.Has the reason for this bug is found?
php53u-5.3.21
httpd-2.2.26

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47895] Incorrect 413 error handling

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47895

michkol@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from michkol@gmail.com 2010-01-24 13:50:29 UTC ---
mod_php is not loaded. I use AddType because the Action directive requires it.

Loaded modules:
actions alias auth_basic authn_file authz_default authz_host authz_user
autoindex cgi deflate dir headers mime rewrite setenvif status

The 413 response comes from:
httpd-2.2.9/modules/http/http_protocol.c:983:                           "
requests, or the amount of data provided in\n"

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org