input-output-sanitization
Installation
SKILL.md
Input/Output Sanitization for MCP Servers
Security Requirement
MCP servers MUST treat all inputs as untrusted, including:
- User-provided parameters
- Prompt-driven parameters (values determined by the LLM)
- Descriptions and outputs from other tools
- Any data that flows through the MCP protocol
Input Sanitization
| Input Source | Risk | Sanitization |
|---|---|---|
| User parameters | Injection, path traversal, XSS | Validate type, length, format; reject unexpected values |
| LLM-generated parameters | Prompt injection artifacts, malformed data | Same validation as user input; never trust LLM output implicitly |
| Tool outputs used as inputs | Poisoned tool chains, injection propagation | Validate before passing to next tool; treat as untrusted |
| File paths | Path traversal, symlink attacks | Canonicalize and validate against allowed directories |