feat: enforce SSRF protection for MCP config-directed traffic - #28242
Conversation
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
2e5292c to
85bb3af
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85bb3af7bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
85bb3af to
814375a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
814375a to
78f219b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78f219bc06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
78f219b to
573efd3
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 573efd387b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
573efd3 to
65a3878
Compare
|
@codex review |
Documentation CheckNew Documentation Needed
Note The generated reference docs ( Automated review via Coder Agents |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
65a3878 to
32e109c
Compare
|
@codex review |
50221da to
2cb04fe
Compare
2cb04fe to
6ffda35
Compare
6ffda35 to
ef77e94
Compare
ef77e94 to
b01077b
Compare
b01077b to
6590af1
Compare
63aae9e to
8486714
Compare
The MCP SSRF guard was extracted into github.com/coder/safedial so other services can share it. Beyond the extraction, safedial hardens the same policy: it panics instead of silently substituting a blank transport for unguardable bases, preserves cookie jars, decodes every RFC 6052 NAT64 layout, fails closed on invalid addresses, and bounds dials to 30s even without a caller deadline.
safedial panics when http.DefaultTransport has been globally replaced with a non-*http.Transport instead of silently guarding a blank transport, so the transport-isolation test must install its counting sentinel only after coderd's guarded MCP client is constructed.
8486714 to
0676c6d
Compare
Routes all MCP config-directed traffic from coderd and chatd through a shared SSRF-protected HTTP client, now that organization admins, not only deployment admins, control MCP server URLs (#27942 and its stack below).
Summary
coder/safediallibrary: it blocks private and special-purpose destinations at dial time (validating resolved addresses at connection time so DNS rebinding cannot bypass the check) and rejects cross-origin redirects.--mcp-allowed-private-cidrs(CODER_MCP_ALLOWED_PRIVATE_CIDRS) option.Merge window
This protection originally lived inside #27942 and was split out to keep that diff reviewable. Until this PR lands, the stack below ships with only main's existing discovery IP-range guard (
CODER_MCP_OAUTH2_DISCOVERY_ALLOWED_IP_RANGES), while org admins can already point MCP configs at arbitrary URLs. This PR should merge promptly after the stack below it.Top of the MCP org-separation stack (CODAGT-711 -> CODAGT-717 audit -> CODAGT-712 ACLs -> CODAGT-806 token RBAC -> CODAGT-714 org picker -> this PR).