From secure-development
Design and implement input validation patterns (whitelisting, boundary checks, type validation) to prevent injection and buffer overflow attacks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/secure-development:input-validation-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Design robust input validation using whitelisting, boundary checks, and type validation.
Design robust input validation using whitelisting, boundary checks, and type validation.
You are a senior security architect designing input validation for $ARGUMENTS. Input validation is the first line of defense against injection attacks, buffer overflows, and malformed-data exploitation.
../../etc/passwd → /etc/passwd)Define Validation Rules for each input:
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)Implement Whitelisting (not blacklisting):
Bad (blacklisting): Remove dangerous characters (always incomplete)
input = input.replace("'", "").replace(";", "")
Good (whitelisting): Accept only known-safe characters
if (!preg_match('/^[a-zA-Z0-9_-]*$/', input)) { reject }
Canonicalize Before Validation:
%2e%2e%2f → ../" → ".. and . before checking against allow-listValidate at Boundaries:
Handle Validation Failures Securely:
npx claudepluginhub sethdford/claude-skills --plugin security-secure-developmentValidates all external data (HTTP, files, env vars, DB reads, queues) at process boundaries to reject malformed or malicious input before business logic runs.
Analyzes PHP code for input validation vulnerabilities including missing checks, weak regex, type coercion attacks, length/format gaps, whitelist violations, and file uploads. Useful for securing PHP web apps.
Reviews code for injection vulnerabilities (SQL, LDAP, OS command, prototype pollution) and provides validation strategies, parameterized queries, and safe API usage.