Input Validation Patterns

Design and implement input validation patterns (whitelisting, boundary checks, type validation) to prevent injection and buffer overflow attacks.

48 stars 10 forksOther Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add sethdford/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sethdford/claude-skills --skill input-validation-patterns
Manual install
git clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/security/secure-development/skills/input-validation-patterns ~/.claude/skills/input-validation-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Input Validation Patterns

Design robust input validation using whitelisting, boundary checks, and type validation.

## Context

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.

## Domain Context

- **Whitelisting vs. Blacklisting**: Whitelist allowed characters/patterns (safe-list approach); blacklisting is fragile and incomplete
- **Validation Points**: Validate at every trust boundary; don't assume data from database or internal APIs is safe
- **Canonicalization**: Normalize input (remove encoding, aliases) before validation (e.g., `../../etc/passwd` → `/etc/passwd`)
- **Type Safety**: Enforce data types (integer, email, UUID); avoid string representations that get misinterpreted

## Instructions

1. **Define Validation Rules** for each input:
   - **Type**: Integer, string, email, UUID, date, IP address, etc.
   - **Length**: Min and max length (prevents buffer overflow, DoS)
   - **Format**: Regex or pattern (email: `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`)
   - **Range**: Min/max value for numbers (e.g., age 0-150, quantity 1-1000)
   - **Allowed Characters**: Whitelist (e.g., for filename: alphanumeric, dash, underscore only)
   - **Business Rules**: Must be unique, must exist in reference table, must be in future, etc.

2. **Implement Whitelisting** (not blacklisting):
Read the full skill on GitHub

Details

Skill name
input-validation-patterns
Path
security/secure-development/skills/input-validation-patterns/SKILL.md
License
MIT
Repo updated
11 March 2026

FAQ

What does the Input Validation Patterns skill do?

Design and implement input validation patterns (whitelisting, boundary checks, type validation) to prevent injection and buffer overflow attacks.

How do I install the Input Validation Patterns skill?

Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Input Validation Patterns popular?

It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.