Problem
The Agent OAuth route performs synchronous URL validation, but its MCP/@adcp SDK discovery, dynamic registration, and token requests still default to global fetch. A public hostname can therefore pass preflight and rebind to a loopback/private address at dial time; redirects to private literals are also unsafe without per-hop validation.
This is an authenticated blind-SSRF reachable from org-managed agent contexts.
Acceptance criteria
- Inject a scoped SSRF-safe fetch into PRM discovery, authorization-server discovery, OAuth start/DCR, callback/token exchange, and status discovery.
- Support the SDK request shapes actually used: GET discovery plus JSON and URL-encoded POST bodies.
- Preserve abort signals and required headers.
- Validate every redirect hop and enforce connect-time DNS pinning using the existing
safeFetch primitive.
- Tests prove fetch injection across each route flow and adapter request normalization.
Medium/P1 follow-up from Argus review of #5958. Keep trailing-dot hostname normalization separate in #5959.
Problem
The Agent OAuth route performs synchronous URL validation, but its MCP/@adcp SDK discovery, dynamic registration, and token requests still default to global
fetch. A public hostname can therefore pass preflight and rebind to a loopback/private address at dial time; redirects to private literals are also unsafe without per-hop validation.This is an authenticated blind-SSRF reachable from org-managed agent contexts.
Acceptance criteria
safeFetchprimitive.Medium/P1 follow-up from Argus review of #5958. Keep trailing-dot hostname normalization separate in #5959.