Skip to content

HTTP/2: enforce strict 3-digit :status pseudo-header#639

Open
arturobernalg wants to merge 1 commit intoapache:masterfrom
arturobernalg:http2-strict-status
Open

HTTP/2: enforce strict 3-digit :status pseudo-header#639
arturobernalg wants to merge 1 commit intoapache:masterfrom
arturobernalg:http2-strict-status

Conversation

@arturobernalg
Copy link
Member

@arturobernalg arturobernalg commented Feb 24, 2026

Current code uses Integer.parseInt(statusText), which accepts non-conformant values such as "+200" and "0200" (both parse to 200) even though :status must carry an HTTP status code.

RFC 9110: Status Codes The status code of a response is a three-digit integer code that describes the result of the request and the semantics of the response, including whether the request was successful and what content is enclosed (if any). All valid status codes are within the range of 100 to 599, inclusive

RFC 9113 8.3.2 - Response Pseudo-Header Fields This pseudo-header field MUST be included in all responses, including interim responses; otherwise, the response is malformed (Section 8.1.1).

Replace Integer.parseInt-based parsing with a strict 3-char digit check
(first digit 1..5) to reject values like "+200" and "0200".
@arturobernalg arturobernalg requested a review from ok2c February 24, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant