← Back to list

input-validation-sanitization-auditor
by patricio0312rev
Comprehensive library of +100 production-ready development skills covering every aspect of modern software engineering. From project setup to production deployment, from security hardening to performance optimization.
⭐ 6🍴 0📅 Jan 19, 2026
SKILL.md
name: input-validation-sanitization-auditor description: Identifies and fixes XSS, SQL injection, and command injection vulnerabilities with validation schemas, sanitization libraries, and safe coding patterns. Use for "input validation", "XSS prevention", "SQL injection", or "sanitization".
Input Validation & Sanitization Auditor
Prevent injection attacks through proper input handling.
XSS Prevention
// ❌ DANGEROUS: Direct HTML injection
app.get("/search", (req, res) => {
res.send(`<h1>Results for: ${req.query.q}</h1>`); // XSS!
});
// ✅ SAFE: Properly escaped
import { escape } from "html-escaper";
app.get("/search", (req, res) => {
res.send(`<h1>Results for: ${escape(req.query.q)}</h1>`);
});
// ✅ BETTER: Template engine with auto-escaping
res.render("search", { query: req.query.q }); // EJS/Pug escape by default
SQL Injection Prevention
// ❌ DANGEROUS: String concatenation
const userId = req.params.id;
const query = `SELECT * FROM users WHERE id = '${userId}'`; // SQL Injection!
db.query(query);
// ✅ SAFE: Parameterized queries
db.query("SELECT * FROM users WHERE id = $1", [userId]);
// ✅ BEST: ORM (Prisma)
await prisma.user.findUnique({ where: { id: userId } });
Input Validation Schema
import { z } from "zod";
const userSchema = z.object({
email: z.string().email().max(255),
password: z.string().min(12).max(128),
age: z.number().int().min(13).max(120),
website: z.string().url().optional(),
});
app.post("/register", async (req, res) => {
try {
const validated = userSchema.parse(req.body);
await createUser(validated);
res.json({ success: true });
} catch (error) {
res.status(400).json({ error: error.errors });
}
});
Output Checklist
- XSS prevention (escaping, CSP)
- SQL injection prevention (parameterized queries)
- Command injection prevention
- Input validation schemas
- Output encoding
- Sanitization libraries
- Security tests ENDFILE
Score
Total Score
70/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


