part 5Security: the attack behind each rule·lesson 5.5 of 5·2 min read
Tokens in URLs, HTTPS and the non-optional rules
Every non-optional rule in MCP authorization exists because of a concrete attack. This lesson lists each rule (Bearer tokens only in the header, a token on every request, HTTPS, localhost or HTTPS redirects, PKCE, resource, audience checks, iss) together with the risk it prevents and the revision it dates from.
In this lesson
Connect each non-optional MCP authorization rule with the risk it prevents.
Say in which revision each rule became mandatory.
Spot which rule a given implementation breaks.
Each rule and the risk it prevents
Rule
Risk it prevents
Since
Token in Authorization: Bearer, never in the URL
URLs end up in server and proxy logs, browser history, the Referer header, screenshots
2025-03-26
Token on every request
Relying on sessions or on "they already authenticated earlier" (session hijacking)
2025-03-26
401 if the token is missing, invalid or expired
Ambiguous behavior; the client knows it must re-authenticate
2025-03-26
HTTPS on authorization endpoints
Theft of codes and tokens on the network
2025-03-26
redirect_uri must be localhost or HTTPS
Codes sent in clear text or to uncontrolled destinations
2025-03-26
PKCE mandatory
Code interception (lesson 5.1)
2025-03-26
resource in the authorization and token requests
Tokens reusable on other servers (lesson 5.2)
2025-06-18
Reject tokens issued for someone else
The other half of the previous rule; passthrough (lesson 5.3)
2025-06-18
Verify that the AS advertises PKCE
Flows that are "silently" unprotected
2025-11-25
CIMD at an https URL with a path, and a matching client_id
Client impersonation
2025-11-25
Record the issuer and check iss
Mix-up (lesson 5.4)
2026-07-28
For the full lists of non-optional rules, revision by revision, see lesson 7.3.
Summary
Every mandatory rule has an attack behind it.
Review lesson 7.3 for the checklists by revision.
quiz · 4 questions
1. A client calls https://mcp.example.com/mcp?access_token=eyJ... Which rule does it break?
Besides being insecure, it is explicitly forbidden in MCP: the token goes only in the Authorization: Bearer header.
2. An MCP server validates the token at initialize and afterwards only checks Mcp-Session-Id. Which rule does it break?
The session is not a credential: the token must travel and be validated on every request.
3. A 2025-11-25 client follows the flow with an AS whose metadata does not include code_challenge_methods_supported. Which rule does it break?
It should have refused to proceed.
4. An AS accepts redirect_uri=http://app.example.com/callback (HTTP, not localhost) for an MCP client. Which rule does it break?