This MCP StreamableHTTPServerTransport is created without DNS-rebinding protection (CWE-346).
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
enableDnsRebindingProtection defaults to false in the TypeScript SDK, so a malicious web page the user visits can rebind a DNS name to the loopback address and POST to the local MCP server, driving its tools cross-origin from the browser. This is CVE-2025-66416.
Enable it and pin the Host/Origin allow-lists: new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), enableDnsRebindingProtection: true, allowedHosts: ['127.0.0.1:3000'], allowedOrigins: ['https://app.example.com'], })
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.mcp.dns-rebinding-unprotected -- <reason>