MCP security

Risk inventory for model-context tooling, resource access, manifests, and tool execution boundaries.

RiskCWEWhy it mattersSafer design
Prompt injection sinksCWE-77Malicious input manipulates tool behaviourTreat tool outputs as untrusted and sanitize inputs
Command injectionCWE-78Tool executes attacker-controlled shell commandsUse parameterized calls and avoid shell interpolation
SSRF in fetch toolsCWE-918Tool accesses internal servicesAllowlist domains and block private IP ranges
Secret leakage via env varsCWE-526Secrets exposed through tool accessUse secret managers and narrow access
Capability escalationCWE-269Tool gains more permissions than declaredEnforce least privilege and validate scope
Missing rate limitsCWE-400Runaway tool calls exhaust resourcesRate-limit calls and enforce timeouts
TOCTOU file racesCWE-367File state changes between check and useUse atomic operations and locks
Missing auth on resources/listCWE-862Resource listings expose dataRequire authorization on listing endpoints
Zombie subprocessesCWE-404Subprocesses exhaust resourcesReap children and use process groups
Unverified manifest signingCWE-347Unverified manifests enable supply chain attacksVerify signatures and pin versions