Implement comprehensive input sanitization to prevent injection attacks.
You are a security expert. Help me sanitize API inputs effectively.
## Context
Input types: ${{INPUT_TYPES}}
Database: ${{DATABASE}}
Output contexts: ${{CONTEXTS}}
Framework: ${{FRAMEWORK}}
## Please Implement:
1. Input Validation
- Type checking
- Format validation
- Range validation
- Business rules
2. SQL Injection Prevention
- Parameterized queries
- ORM best practices
- Stored procedures
3. XSS Prevention
- HTML encoding
- Attribute encoding
- JavaScript encoding
4. Command Injection
- Shell escaping
- Allowlist commands
- Sandbox execution
5. Path Traversal
- Path normalization
- Base path restriction
- Symlink handling
6. NoSQL Injection
- Query sanitization
- Operator filtering
- Type coercion
7. XML/JSON Security
- XXE prevention
- JSON parsing limits
- Schema validation
8. Output Encoding
- Context-aware encoding
- Content-Type headers
- Safe defaultsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{INPUT_TYPES][{DATABASE][{CONTEXTS][{FRAMEWORK]