input-output-sanitization
/input-output-sanitization
Enforce input and output sanitization in MCP servers. Use when building or reviewing MCP server request handling, tool invocation, or response processing.
- Author
- redhatproductsecurity ↗
- Repository
- prodsec-skills ↗
- Licence
- Apache-2.0
- Last repository change
- 15.07.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 15.07.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Enforce input and output sanitization in MCP servers. Use when building or reviewing MCP server request handling, tool invocation, or response processing.
Original author description
Enforce input and output sanitization in MCP servers. Use when building or reviewing MCP server request handling, tool invocation, or response processing.
How it works
- Security Requirement
- Input Sanitization
- Output Sanitization
- Key Principle
- Implementation Checklist
SKILL.md preview
--- name: input-output-sanitization description: Enforce input and output sanitization in MCP servers. Use when building or reviewing MCP server request handling, tool invocation, or response processing. category: "secure_development" subcategory: "mcp-server" --- # 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 | ## Output Sanitization Tool outputs returned to clients or passed to other tools must also be sanitized: - Strip or escape content that could be interpreted as code or commands - Validate output format matches the expected schema - Truncate excessively large outputs to prevent resource exhaustion - Scrub sensitive data from outputs before returning to clients ## Key Principle Never assume any input is safe because it came from "inside" the system. LLM-generated content and inter-tool communication are just as untrusted as external user input. ## Implementation Checklist - [ ] Validate all input parameters (type, length, format, allowed values) - [ ] Treat LLM-generated parameters as untrusted input - [ ] Treat outputs from other tools as untrusted input - [ ] Implement path traversal prevention for any file path parameters - [ ] Sanitize outputs before returning to clients - [ ] Validate output format against expected schemas - [ ] Truncate excessively large outputs - [ ] Log sanitization actions (blocked or modified inputs) for security monitoring
Versions
The database has no other skills named input-output-sanitization.
Database snapshot: 13.11.2026 · package version 69bd5d234e47 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100scanning-input-validation-practices
Scan for input validation vulnerabilities and injection risks. Use when reviewing user input handling. Trigger with 'scan input validation', 'check injection vulnerabilities', or 'validate sanitization'. - 100scanning-input-validation-practices
Scan for input validation vulnerabilities and injection risks. Use when reviewing user input handling. Trigger with 'scan input validation', 'check injection vulnerabilities', or 'validate sanitization'. - 100secure-token-handling
Enforce secure token validation and storage in MCP servers. Use when implementing or reviewing token handling, JWT validation, or token storage in MCP servers. - 100roots-support
Enforce roots directive support in MCP servers. Use when building or reviewing MCP server filesystem access, directory scoping, or path boundary enforcement. - 90input-validation
Reviews input validation and sanitization across the application for injection and malformed-input risks. Use when auditing how untrusted input is handled. - 100content-sanitization
Provides sanitization guidelines for external content in skills and hooks. Use when loading GitHub Issues, PRs, WebFetch results, or any untrusted input.