Skip to content

http: reject versionless CONNECT requests in legacy parser#46236

Open
nezdolik wants to merge 1 commit into
envoyproxy:mainfrom
nezdolik:leg-http-parser-connect-fix
Open

http: reject versionless CONNECT requests in legacy parser#46236
nezdolik wants to merge 1 commit into
envoyproxy:mainfrom
nezdolik:leg-http-parser-connect-fix

Conversation

@nezdolik

Copy link
Copy Markdown
Member

Reject versionless CONNECT requests in the legacy HTTP parser.

Previously, these requests were treated as HTTP/0.9, causing Envoy to return an HTTP/1.0 error response. The parser now rejects them before protocol classification, preserving an HTTP/1.1 400 response.

Commit Message: Reject versionless CONNECT requests in the legacy HTTP parser.
Additional Description:
Risk Level:
Testing: Done
Docs Changes:
Release Notes:
Platform Specific Features:
Fixes #28902

Malformed CONNECT request lines that end before an HTTP version is parsed are treated as HTTP/0.9 by http-parser. Envoy then maps this to HTTP/1.0 and emits an HTTP/1.0 400 response.

Reject versionless CONNECT requests in the parser so Envoy retains HTTP/1.1 for the error response. Add regression coverage for issue envoyproxy#28902.

Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>

@RyanTheOptimist RyanTheOptimist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Should we consider a runtime guard?

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.

With http-parser Envoy produces invalid HTTP version for CONNECT without authority

3 participants