fix(-pr http11): disable retryablehttp HTTP/2 fallback when http11 protocol is forced#2438
Conversation
Incremental Security Review - Commit 3f038efReviewed the incremental changes between commit 0e65470 and 3f038ef. Only 1 file was modified (common/httpx/httpx.go) with 6 lines added. No exploitable security vulnerabilities were found in the changes. 📌 Key Takeaways
|
… protocol is set
When -pr http11 is used, httpx correctly sets TLSNextProto={} and
GODEBUG=http2client=0 to force HTTP/1.1. However retryablehttp-go's
automatic HTTP/2 fallback in do.go silently bypasses this:
if err is malformed HTTP/2 response {
resp, err = c.HTTPClient2.Do(req.Request) // <- ignores http11 config
}
This commit sets retryablehttpOptions.DisableHTTP2Fallback=true when
Protocol=="http11", ensuring the HTTP/1.1-only requirement is honoured
end-to-end.
Depends on: projectdiscovery/retryablehttp-go#532
Fixes: projectdiscovery#2240
0e65470 to
3f038ef
Compare
|
Force-pushed to clean up the branch — it had accidentally included unrelated commits from the fork point. The PR now contains only the single-line fix: retryablehttpOptions.DisableHTTP2Fallback = trueThe SQL injection warning from Neo was from pre-existing code in the old diff, not from this PR. |
Mzack9999
left a comment
There was a problem hiding this comment.
The PR should target the dev branch
|
This issue has been resolved by merging #2424. This PR's approach — setting |
Problem
When
-pr http11is used, httpx correctly disables HTTP/2 at the transport level:However, retryablehttp-go has an automatic fallback in
do.gothat silently upgrades to HTTP/2 when it sees a malformed HTTP/2 error:This means
-pr http11has no effect for servers that respond with HTTP/2, because retryablehttp-go overrides the protocol choice viaHTTPClient2.Fixes #2240
Fix
This PR sets
retryablehttpOptions.DisableHTTP2Fallback = truewhenProtocol == "http11", which (via projectdiscovery/retryablehttp-go#532) skips theHTTPClient2.Dofallback and honours the HTTP/1.1-only requirement end-to-end.Dependency
Requires projectdiscovery/retryablehttp-go#532 to be merged first (adds the
DisableHTTP2Fallbackoption).Testing