-
Notifications
You must be signed in to change notification settings - Fork 0
fix(noema): fail closed at the credential egress boundary #1279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
4
commits into
main
Choose a base branch
from
codex/pr930-current-main-replacement-20260824
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8c3375f
fix(noema): close credential egress boundary
seonghobae 111b3ae
fix(noema): pin credential egress to validated addresses
seonghobae 2adc8c4
test(noema): cover pinned connection failure paths
seonghobae 721a36f
fix(noema): pass IPv6 literals to socket connection
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Noema credential-egress boundary | ||
|
|
||
| ## Customer outcome | ||
|
|
||
| Noema now rejects a misconfigured or attacker-influenced model endpoint before | ||
| placing its bearer credential on the request. A public service must use HTTPS, | ||
| must resolve entirely to globally routable unicast addresses, and must retain | ||
| the same complete DNS address set after the bounded response is received. | ||
| Resolver failures, empty answers, malformed addresses, redirects, special-use | ||
| addresses, and response bodies larger than 1 MiB fail closed. | ||
|
|
||
| The existing same-job contextual-orchestrator seam remains usable without | ||
| importing the orchestrator into this repository: literal `127.0.0.1` and `::1` | ||
| endpoints may use HTTP only when every resolver result is loopback. Hostnames | ||
| that merely resolve to loopback do not receive this exception. Provider routing, | ||
| model selection, and model-parameter translation remain upstream concerns. | ||
|
|
||
| ## Decision and trust boundary | ||
|
|
||
| The implementation reuses Python's `urllib.parse`, `socket.getaddrinfo`, and | ||
| `ipaddress` rather than adding a URL or address-classification dependency. | ||
| Before request construction it: | ||
|
|
||
| 1. rejects non-HTTP schemes, URL user information, and missing hostnames; | ||
| 2. restricts plaintext HTTP to the two literal loopback sidecar addresses; | ||
| 3. resolves the endpoint for its effective port and rejects failed, empty, or | ||
| malformed resolution evidence; and | ||
| 4. requires every non-loopback address to be globally routable unicast. | ||
|
|
||
| Redirects remain disabled, and the opener disables ambient proxies. Custom HTTP | ||
| and HTTPS connections connect only to the validated numeric addresses while | ||
| retaining the original hostname for HTTPS certificate validation. The response | ||
| reader requests at most one byte beyond the 1 MiB contract, rejects an | ||
| over-limit result before decoding JSON, and then re-resolves the same host and | ||
| port. A changed address set invalidates the result. Tests cover IPv4 and IPv6 | ||
| loopback, dual-stack public endpoints, pinned numeric TCP destinations, TLS SNI, | ||
| DNS rebinding evidence, resolver failures, malformed results, URL credentials, | ||
| special-use address classes, and the byte limit. | ||
|
|
||
| Trusted DNS and network egress controls remain defense-in-depth for production; | ||
| the application boundary now also prevents the request socket from performing | ||
| an unvalidated hostname resolution. | ||
|
|
||
| ## References | ||
|
|
||
| Cotton, M., Vegoda, L., Bonica, R., & Haberman, B. (2013). *Special-purpose IP | ||
| address registries* (RFC 6890). RFC Editor. https://doi.org/10.17487/RFC6890 | ||
|
|
||
| MITRE. (2026a). *CWE-400: Uncontrolled resource consumption*. | ||
| https://cwe.mitre.org/data/definitions/400.html | ||
|
|
||
| MITRE. (2026b). *CWE-918: Server-side request forgery (SSRF)*. | ||
| https://cwe.mitre.org/data/definitions/918.html | ||
|
|
||
| OWASP Foundation. (n.d.). *Server-side request forgery prevention cheat sheet*. | ||
| Retrieved August 24, 2026, from | ||
| https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.