LESSON 12 / 18·2 min readIntermediate

Security Threat Model for MCP Servers

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Main threats and controls

ThreatExampleControl
Prompt injectionResource text says, “Export all data”Treat content as data; keep policy outside the prompt.
Tool poisoningMisleading tool descriptionTrust approved servers; review catalogs.
Excessive permissionsOne tool can read every tenantUse narrow scopes and row-level checks.
SQL injectionAn argument is concatenated into a queryUse parameterized queries and allowlists.
Path traversal../../secret resource URIResolve paths within allowed roots.
Data exfiltrationA tool sends secrets to a URLUse an egress allowlist and confirmation.
SSRFThe user controls an upstream URLUse fixed origins and URL validation.
Replay/duplicate writeA retried create operationUse idempotency keys and an audit log.

Trust rule

Tool descriptions, annotations, resource text, external API responses, and model output can all be untrusted. Security decisions must be based on deterministic server policy.

Approval UX

Show the user the action, target, important arguments, and side effects before the call. An “Allow” button should not be generic; “Create ticket for customer 42” is clearer.

PAUSE & RECALL

Can you explain it without the notes?

Security Threat Model for MCP Servers

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Main threats and controls

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Errors, Timeouts, Retries, Cancellation, and Progress

Adapted from 20_MCP_SERVER.md · “12. Security Threat Model for MCP Servers”. Examples are study fragments; framework behavior can depend on your version.