Repository navigation
fix(hosting): match uvicorn's strict CIDR parsing for trusted proxies - #1150
Merged
Merged
Conversation
TrustedPeers parsed trusted_proxy entries with strict=False, so a CIDR with host bits set (10.0.0.5/24) trusted the whole /24 in ForwardedHostMiddleware while uvicorn's ProxyHeadersMiddleware treated the same entry as a literal that matches nothing. ForwardedHost could therefore trust peers ProxyHeaders did not. Parse strictly, like uvicorn, and log a WARNING naming the intended network so the now-inert entry does not fail silently. Split out of #1137. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXHA3ZEgbUuM5mzoeC4DTw
Deploying simple-module-python with
|
| Latest commit: |
8f3c7d9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ece6a93c.simple-module-python.pages.dev |
| Branch Preview URL: | https://claude-project-thread-lg6bda.simple-module-python.pages.dev |
…-lg6bda # Conflicts: # CHANGELOG.md
antosubash
marked this pull request as ready for review
November 29, 2026 08:23
Owner
Author
|
/ship passed on 8f3c7d9 |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 29, 2026
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.
Requested by Anto · project thread
Summary
Split 1 of 3 from #1137, independent of the other two.
TrustedPeers(used byForwardedHostMiddleware) parsedtrusted_proxyentries withstrict=False, so10.0.0.5/24trusted all of10.0.0.0/24. uvicorn'sProxyHeadersMiddlewareparses the same entry strictly and treats it as a literal that matches nothing, which meant ForwardedHost could trust peers that ProxyHeaders did not.did you mean 10.0.0.0/24?) is logged when the middleware is built, so the entry no longer fails silently. ProxyHeaders behaviour is unchanged (it was already strict).docs/framework/middleware.mdanddocs/reference/env-vars.mdupdated.Test plan
TestPeers::test_cidr_with_host_bits_set_trusts_no_peer(asserts no trust plus the warning)framework/hosting/testspass, except 3 frontend typecheck tests that also fail onmainin this sandbox (nonpm install)Generated by Claude Code