v0.14 is out: a mobile auth pack for Swift/iOS and Android, catching insecure token storage, cleartext traffic, and OAuth in embedded WebViews. Read more →
HIGH AI PREVALENCE: HIGH auth.mcp.dns-rebinding-unprotected

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'], })

VULNERABLE
vulnerable.ts
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
import { randomUUID } from 'node:crypto';

// ruleid: auth.mcp.dns-rebinding-unprotected
const t1 = new StreamableHTTPServerTransport({
  sessionIdGenerator: () => randomUUID(),
});

// ruleid: auth.mcp.dns-rebinding-unprotected
const t2 = new StreamableHTTPServerTransport({
  sessionIdGenerator: () => randomUUID(),
  enableDnsRebindingProtection: false,
  allowedHosts: ['127.0.0.1:3000'],
});
SAFE
safe.ts
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
import { randomUUID } from 'node:crypto';

const t1 = 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>

References

https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization ↗https://www.cve.org/CVERecord?id=CVE-2025-66416 ↗https://cwe.mitre.org/data/definitions/346.html ↗