security-input-validation

security-input-validation is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 74 tokens per session (1,751 once invoked), scanned B, original, Apache-2.0.

A guide for checking and safely handling untrusted data, such as requests, uploads, webhooks, and third-party responses.

In plain words
What is it for?
Use it to define boundary schemas, reject invalid fields, parameterise database queries, escape output, and limit input size.
Why use it?
It reduces risks from malformed input, injection, cross-site scripting (XSS), path traversal, and oversized requests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define boundary schemas, reject invalid fields, parameterise database queries, escape output, and limit input size.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/security-input-validation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill security-input-validation
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-input-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/security-input-validation/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-input-validation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for security-input-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-input-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,751 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.01751
Opus 5.5 $0.00030 $0.00700
Sonnet 5.5 $0.00015 $0.00350
Haiku 4.5 $0.00007 $0.00175

Measured 2mo ago against content hash d18cfbcb200a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

security-input-validation scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

and reject private, loopback, link-local and metadata addresses (`169.254.169.254`)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

runner/skills/security-input-validation/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Validate and sanitize untrusted input

Everything that crosses a trust boundary is hostile until proven otherwise. That includes HTTP input, webhooks, message payloads, files, environment-sourced URLs and third-party API responses. The defence has two halves. Validate at the boundary, so malformed input is rejected. Encode or parameterise at every sink, so input that passes validation still cannot change the meaning of SQL, HTML, a shell command or a path. Validation alone never prevents injection (OWASP Input Validation Cheat Sheet; ASVS 5.0 V1 and V2).

Procedure

  1. Map the flow. For each new input, write down its source, the sinks it reaches (DB query, HTML/template, shell, filesystem path, outbound URL, regex, log, CSV export, email header, deserialiser) and its type. Call search_lore for the repo's validator, error envelope and sanitising helpers, then copy a sibling endpoint.
  2. Validate at the trusted boundary with a schema (Zod, Pydantic, Bean Validation, or the repo's own). Validate on the server, never only on the client (ASVS 2.2.2).
    • Canonicalise once, then validate (ASVS 1.1.1): decode percent-encoding and charset once, and apply Unicode NFKC to identifiers before comparing them.
    • Check syntax (type, format, length, range, enum, anchored allow-list regex), then semantics (end after start, quantity within stock, currency matches the account).
    • Reject unknown fields and bind to an allow-listed DTO. This also prevents mass assignment.
    • Reject with the repo's standard 400/422 (RFC 9457 problem details if the repo uses it). Do not echo the offending value back or leak internals.
  3. Bound everything. Set a body-size limit at the parser, maximum string length, maximum array length and maximum nesting depth. Check length before running any regex. Use anchored regexes with no nested quantifiers such as (a+)+, or a linear-time engine, to avoid ReDoS (ASVS 1.3.12). Rate limits belong to the rate-limiting skill.
  4. Make each sink safe by construction.
    • SQL/NoSQL: use parameters or the ORM. Identifiers such as sort columns go through an allow-list map. Never concatenate.
    • Shell: pass an argv array with no shell=True or sh -c interpolation, and put -- before user-supplied arguments.
    • Paths: never use a user-supplied name as a path. Generate the name. Otherwise resolve the real path and assert it stays under the base directory.
    • Temporary files: use unique, unpredictable names from mkstemp, fs.mkdtemp or a UUID, never a user filename or a timestamp. Colliding temp names under concurrent requests shipped as HTTP 500s in past Gaffer builds.
    • HTML: rely on template auto-escaping. Use innerHTML/dangerouslySetInnerHTML only on output from a vetted sanitiser such as DOMPurify. Use context-specific encoding for attributes, URLs and JS. Allow only http/https in user URLs.
    • Outbound URLs (SSRF, ASVS 1.3.6): allow-list scheme, host and port. Resolve DNS and reject private, loopback, link-local and metadata addresses (169.254.169.254) at connect time, and re-check on every redirect or disable redirects.
    • Parsers: disable XXE and external entities, use no unsafe deserialiser on untrusted data (pickle, yaml.load, Java native), and never build templates from input (SSTI).
    • CSV/XLSX export: prefix cells that start with =, +, -, @, tab, CR or NUL (ASVS 1.2.10; OWASP CSV Injection).
    • Logs: strip CR/LF or use structured logging, so input cannot forge log lines.
    • Redirect targets (returnTo): relative paths or an allow-list only.
    • File uploads: follow the file-uploads skill.
  5. Treat third-party responses as input. Validate them with a schema before use. Verify webhook signatures with a constant-time compare before parsing the body.
  6. Test the boundary with table-driven cases that go through the real handler:
    • Valid input at the minimum and maximum. Just outside each bound. The wrong type. An unknown field. An oversized body. An empty or null value. A non-canonical Unicode form.
    • One payload per sink, asserting that the input is treated as data: ' OR 1=1-- matches no extra rows, ../../etc/passwd is rejected, and <script>alert(1)</script> renders escaped. An internal URL (http://127.0.0.1/, http://169.254.169.254/) is refused, and =cmd|' /C calc'!A0 is neutralised in the export.
    • If concurrent requests write temp files or shared state, add a test that fires them in parallel and asserts that all of them succeed.
    • For parsers and normalisers, use the property-based-test skill.
  7. Evidence. Record the test command and summary as test_output through the record-evidence skill, then stop.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +65 lines scan A → B d18cfbcb200a
  2. 3mo ago First seen · 52 lines · 74 tokens per session scan A 14da426078b7

Subscribe to this mod's changes

security-input-validation is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,751 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

security-input-validation compared with skills from other repositories

security-input-validation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
security-input-validationtmj-90/gafferSkill14d agoApache-2.0B74Claude Code, Codex
bulwark-brainstormQBall-Inc/the-bulwarkSkill9yesterdayMITA50Claude Code
plan-creationQBall-Inc/the-bulwarkSkill9yesterdayMITA38Claude Code
anthropic-validatorQBall-Inc/the-bulwarkSkill9yesterdayMITA40Claude Code
create-subagentQBall-Inc/the-bulwarkSkill9yesterdayMITA42Claude Code
test-auditQBall-Inc/the-bulwarkSkill9yesterdayMITA0Claude Code
code-reviewQBall-Inc/the-bulwarkSkill9yesterdayMITA61Claude Code