Task 3.2: Authentication and Authorization Posture
Finding where an integration design exposes credentials or lets privileges escalate, and naming the fix for each risk.
Study it
Credential exposure and privilege escalation in integrations
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.
Question 1 · choose 1
An MCP server that implements authorization lets agents build travel bookings over several calls on protocol revision 2026-07-28: create_booking returns a booking ID that later calls pass back as an argument, and the server stores each booking's state under that ID. A design review asks how one customer's agent could be stopped from changing another customer's booking. Which mitigation do the MCP security best practices call for?
ABind each booking ID to the user derived from the verified token, and reject the ID when another principal presents it
BKeep the booking IDs sequential so that the server can look bookings up quickly and audit them in order
CTie each booking to the client's MCP connection instead of passing an ID between calls
DAccept the booking ID as proof of identity, since only the agent that created the booking was ever sent it
Show the answer and why
ABind each booking ID to the user derived from the verified token, and reject the ID when another principal presents it
Correct
Servers must not treat possession of a state handle as authentication, and should key stored state to the authenticated user.
BKeep the booking IDs sequential so that the server can look bookings up quickly and audit them in order
Incorrect
Predictable or sequential identifiers can be guessed; handles should come from a secure random number generator.
CTie each booking to the client's MCP connection instead of passing an ID between calls
Incorrect
The protocol is stateless, so the server can't rely on a connection to relate one call to the next.
DAccept the booking ID as proof of identity, since only the agent that created the booking was ever sent it
Incorrect
An attacker can obtain or guess a handle; possession of a state handle must not count as authentication.
MCP is stateless and has no protocol-level sessions, so servers that need state across requests mint an explicit handle and receive it back as a tool argument. Servers that implement authorization must verify every inbound request and must not treat possession of a handle as authentication. They should use secure, non-deterministic handles and bind each handle server-side to the authenticated user, with the user ID taken from the verified token rather than supplied by the client.
Security requires that developers' Claude Code sessions connect only to the two MCP servers the company has reviewed. The platform team deploys this in managed settings:{
"allowedMcpServers": [
{ "serverName": "github" },
{ "serverName": "tickets" }
]
}A penetration test then connects an unreviewed server that exfiltrates repository data. Which change closes the gap?
AAdd "allowManagedPermissionRulesOnly": true, so that only managed settings can decide what developers are allowed to use
BKeep the serverName entries and add "allowManagedMcpServersOnly": true, so that developers can't add allowlist entries
CReplace the entries with serverUrl or serverCommand entries, and add "allowManagedMcpServersOnly": true beside them
DReplace the entries with serverUrl or serverCommand entries and keep the rest of the managed settings unchanged
Show the answer and why
AAdd "allowManagedPermissionRulesOnly": true, so that only managed settings can decide what developers are allowed to use
Incorrect
That flag locks down permission rules only; it doesn't enforce the MCP allowlist.
BKeep the serverName entries and add "allowManagedMcpServersOnly": true, so that developers can't add allowlist entries
Incorrect
A serverName is the label a user assigns, so an unreviewed server labelled github still matches.
CReplace the entries with serverUrl or serverCommand entries, and add "allowManagedMcpServersOnly": true beside them
Correct
URL and command entries identify the actual server, and the lock stops user allowlists from broadening the managed one.
DReplace the entries with serverUrl or serverCommand entries and keep the rest of the managed settings unchanged
Incorrect
Without the lock, allowlists from every scope merge, so a developer's own settings can broaden the managed list.
A serverName entry is not a security control: it matches the label a user assigns, so anyone can call a server github. To enforce which servers run, use serverUrl or serverCommand entries. Without allowManagedMcpServersOnly, allowlists from every settings scope merge, including a user's own settings, so a user can broaden what the managed allowlist permits; set allowedMcpServers and allowManagedMcpServersOnly together in a managed source.
An MCP server exposes read tools and a few high-risk write tools. Its first design lists every scope in scopes_supported and expects clients to request them all at the first authorization, so that one token covers everything. A security review worries about the impact of a stolen token. Which design do the MCP security best practices recommend?
AKeep one broad token, but shorten its lifetime so that a stolen token stops working sooner
BRequest every scope up front, then log which scopes each tool call actually used
CIssue each user a separate server per scope, so that no single server holds broad permissions
DStart with a minimal scope for low-risk reads, and step up with a WWW-Authenticate scope challenge for privileged tools
Show the answer and why
AKeep one broad token, but shorten its lifetime so that a stolen token stops working sooner
Incorrect
A broad token still enables lateral access and privilege chaining while it's valid.
BRequest every scope up front, then log which scopes each tool call actually used
Incorrect
Logging doesn't reduce the blast radius of a token granted every scope.
CIssue each user a separate server per scope, so that no single server holds broad permissions
Incorrect
The guidance is a progressive scope model on the server, not one server per scope.
DStart with a minimal scope for low-risk reads, and step up with a WWW-Authenticate scope challenge for privileged tools
Correct
The best practices describe a progressive, least-privilege scope model with incremental elevation.
Granting broad scopes up front expands the blast radius of a stolen token, makes revocation harder and obscures intent in audit trails. The MCP security best practices recommend a progressive, least-privilege scope model: a minimal initial scope set for low-risk discovery and read operations, and incremental elevation through targeted WWW-Authenticate scope challenges when privileged operations are first attempted.