https://bz.apache.org/bugzilla/show_bug.cgi?id=70361
Bug ID: 70361
Summary: Requests with HTTP version > 1.1 hang until body
timeout, then 408; worker-thread exhaustion (trunk
regression)
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 40303
--> https://bz.apache.org/bugzilla/attachment.cgi?id=40303&action=edit
PoC script probing HTTP versions > 1.1 and demonstrating worker-thread pool
exhaustion (http12_hang.py)
Intended component: mod_http (HTTP/1 core module) — filed under Core since
Bugzilla has no mod_http component.
Requests with an HTTP version greater than 1.1 (HTTP/1.2, 1.3, 2.0, 3.0, 9.9)
hang until the body timeout and are then answered 408, holding one worker
thread for the whole wait. r_assign_protocol() accepts these versions as valid
(error=none), but h1_post_read_request() only installs the ap_h1_body_in_filter
body filter when proto_num <= 1.1. For proto > 1.1 the body filter is absent,
so ap_discard_request_body() / ap_get_brigade() block in core_in waiting for
body bytes that never arrive, until mod_reqtimeout (default body 20s) or
Timeout (default 60s) fires. This affects ALL proto > 1.1 requests, including
GET without a body, GET with Content-Length: 0, and POST with Content-Length: 5
plus a complete body. Per RFC 9112 section 2.5, HTTP/1.2 and 1.3 should be
processed as 1.1, and unknown major versions should be answered 505.
Measured on trunk 2.5.1-dev (HEAD 756c340), local test server, MPM event,
ThreadsPerChild 4 / MaxRequestWorkers 4:
- GET /index.html HTTP/1.2, 1.3, 2.0, 3.0, 9.9 → 20.02–20.12 seconds, then 408
(default mod_reqtimeout).
- GET HTTP/1.2 with Content-Length: 0 → 20.03 s, then 408.
- POST HTTP/1.2 with Content-Length: 5 and body "hello" → 20.02 s, then 408.
- POST HTTP/1.2 with Transfer-Encoding: chunked and a body → 20.05 s, then 408.
- GET HTTP/1.2 without mod_reqtimeout → 60.05 s, then 408 (= Timeout default).
- Pool exhaustion: 4 concurrent HTTP/1.2 requests plus 1 legitimate GET
HTTP/1.1 → the legitimate GET is delayed 19.51–19.65 s, then 200; the four
hanging requests get 408.
- Trace (LogLevel trace8): the request is processed fully up to the handler,
then blocks 20 s in the core_in input filter → [reqtimeout:info] AH01382:
Request body read timeout → 408. Control: the same requests as HTTP/1.1 answer
200 in 0.00 s.
Trunk-only: this does not exist in 2.4.x — the single ap_http_filter there
handles BODY_NONE → EOS unconditionally for every request. The split of HTTP/1
filters (HTTP_IN into HTTP1_REQUEST_IN / HTTP1_BODY_IN / HTTP1_RESPONSE_OUT) is
a trunk 2.5 refactoring. Per SECURITY.md, bugs that exist only in trunk should
be reported as regular bug reports, not security issues.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]