input-validation-review
Skill0 starsChanged 10 days agoMITView on GitHub
Find and fix injection-class bugs in your own code - SQL injection, OS command injection, XSS, SSRF, path traversal, open redirects, unsafe deserialization, eval and XXE - across Python, JavaScript/TypeScript, PHP, Go, Java/Kotlin, Ruby and HTML templates. A stdlib scanner lists the dangerous sinks with file:line and the safe replacement, then the workflow traces whether untrusted input reaches each one and proposes the fix with safe code examples per language. Use when the user asks to check code for SQL injection, XSS, command injection, SSRF or path traversal, review input validation or sanitization, harden a form/API/file upload/webhook handler, or fix a scanner finding in one of these categories.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- auth-session-reviewSkill
- dependency-auditSkill
- dockerfile-securitySkill
- incident-response-playbookSkill
- owasp-web-reviewSkill
- secrets-scanSkill
- security-headers-checkSkill
- threat-modelingSkill
The file
Files
Input validation review
Sinks are where bugs become exploitable; sources are where untrusted data enters. This skill
finds the sinks fast, then spends the reviewer's time on the data flow between them.
Paths below are relative to this skill's folder (in Claude Code: ${CLAUDE_SKILL_DIR}).
Defensive scope: explain the risk and the fix. Do not produce working attack payloads or
exploitation steps; to prove a fix, write a unit test that sends a harmless marker value
(for example a quote character or ../ segment) and asserts it is handled safely.
When to use
- "Is this code vulnerable to SQL injection / XSS / command injection?"
- Reviewing handlers that take user input: forms, JSON APIs, query strings, headers, file uploads, webhooks, URL fetchers, import/export features
- Fixing a SAST/pentest finding in these categories
- The A05 (Injection) and SSRF parts of
owasp-web-review
When not to use
- Access control bugs (IDOR, missing auth) -
owasp-web-reviewA01 - Secrets in code -
secrets-scan; vulnerable libraries -dependency-audit - Full SAST coverage: for CI use Semgrep or CodeQL as well; this scanner is a fast, dependency-free first pass with deliberately simple line-based rules
Workflow
- List entry points: routes/controllers, CLI args, message consumers, file parsers. Note which framework protections exist (ORM, template auto-escaping, validation library).
- Scan for sinks (read-only).
Categories: sql-injection, command-injection, code-injection, xss, ssrf, path-traversal, open-redirect, deserialization, xxe. Exit 1 = findings at or abovepython3 scripts/risky_patterns.py src/ python3 scripts/risky_patterns.py . --lang php --category sql-injection python3 scripts/risky_patterns.py . --json --fail-on none > sinks.json python3 scripts/risky_patterns.py --list-rules--fail-on(default high). - Trace each high/medium finding from source to sink. A finding is real when data an attacker controls (request params, body, headers, cookies, uploaded file names/contents, webhook payloads, database values originally from users) reaches the sink without a control that is correct for that sink. Validation for a different context does not count (HTML escaping does not protect SQL). Record: source, path, sink, existing controls, verdict.
- Look for what the scanner cannot see: second-order injection (stored, then used later), ORM raw fragments built in helpers, dynamic column/table names, template injection when user input becomes a template, header/CRLF injection, mass assignment, regex DoS on user input, zip/archive extraction paths.
- Fix with the safe pattern for the language from
references/safe-patterns.md. Prefer structural fixes
(parameters, argument arrays, auto-escaping, allow-lists) over escaping or blocklists.
Validate input at the boundary (type, length, format, allow-list) as an additional layer.
Mark reviewed false positives with a
review:ok <reason>comment on the line. - Add a regression test per fixed sink and re-run the scanner.
Output
review points: 9 in 42 files (command-injection 1, sql-injection 3, ssrf 1, xss 4)
HIGH src/routes/search.js:14 [sql-injection] js-sql-template
db.query(`SELECT * FROM items WHERE name = '${req.query.q}'`)
safe: placeholders: db.query('... WHERE id = $1', [id]) ...
| # | Verdict | Category | Location | Source -> sink | Fix |
| 1 | vulnerable | SQLi | src/routes/search.js:14 | req.query.q -> db.query template | $1 placeholder + test |
| 2 | false positive | XSS | src/ui/Help.jsx:8 | constant markdown -> dangerouslySetInnerHTML | review:ok comment |Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

