HTTP/2: enforce strict 3-digit :status pseudo-header#639
Open
arturobernalg wants to merge 1 commit intoapache:masterfrom
Open
HTTP/2: enforce strict 3-digit :status pseudo-header#639arturobernalg wants to merge 1 commit intoapache:masterfrom
arturobernalg wants to merge 1 commit intoapache:masterfrom
Conversation
Replace Integer.parseInt-based parsing with a strict 3-char digit check (first digit 1..5) to reject values like "+200" and "0200".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).