MCP-SEC-001
Invalid Origin header returns HTTP 403
“Servers MUST validate the Origin header on all incoming connections to prevent DNS rebinding attacks. If the Origin header is present and invalid, servers MUST respond with HTTP 403 Forbidden.” — spec anchor
How to fix this
Validate the `Origin` header on every incoming request and answer an invalid one with HTTP 403. This is the DNS-rebinding defence — without it a page in a victim's browser can reach a server bound to localhost.
How the validator checks this
Probe P7.1, against a streamable-http server on the modern protocol. What it reports:
- pass
- An invalid Origin was rejected with 403
- warn
- Request with a foreign Origin returned HTTP … rather than 403 — rejected, but not in the way the spec names
- fail
- Accepted a request with an unrecognised Origin. Servers MUST validate Origin to prevent DNS rebinding, and reject an invalid one with 403.
Quoted from the probe that runs this check, so it cannot drift from what the validator actually reports.
This rule is checked deterministically: a fail here is a certain violation, not an inference.
Check your own server against this rule
The validator makes real protocol requests and reports this rule as pass, warn or fail alongside the other 78. Validate a server or read how the check works.
Other Security posture rules
- MCP-SEC-002Endpoint is HTTPS with a valid, unexpired certificate chain
- MCP-SEC-003Error messages do not echo request headers or credentials
- MCP-SEC-004icons[].src is https: or data:, same-origin, no unsafe scheme
- MCP-SEC-005No $ref in tool schemas resolves to a network URI
- MCP-SEC-006Schema depth and subschema count stay within safe bounds
- MCP-SEC-007Server does not reflect the Authorization header into responses