AGENT SKILL

input-validation-review

Reasons about SSRF, IDOR, mass assignment, injection, file upload abuse, prototype pollution and ReDoS from code and docs evidence. Use when endpoints accept URLs, resource ids, body fields, uploads or any user input that reaches a downstream call.

License 许可
MIT
所属仓库
Eliyce/paqad-ai
最近更新
2026-11-13
Stars
★ 8
Forks
0

01 前言 Front Matter

name
input-validation-review
metadata
{ "cacheable": "false", "model_tier": "reasoning", "paqad-meta": "skill.meta.yaml", "output_format": "markdown" }
description
Reasons about SSRF, IDOR, mass assignment, injection, file upload abuse, prototype pollution and ReDoS from code and docs evidence. Use when endpoints accept URLs, resource ids, body fields, uploads or any user input that reaches a downstream call.

02 资源文件 7

03 SKILL.md 正文

What It Does

Reviews all code paths where user-supplied input reaches security-sensitive operations (outbound HTTP calls, database lookups, ORM constructors, shell commands, template renderers, deserializers, file operations, and regex evaluations) and produces findings for each category that lacks proof of safe handling.

Use This When

When module docs or route inventories describe endpoints that accept URLs, resource IDs, request body fields, file uploads, or any user-controlled parameter that flows into a downstream system call.

Inputs

  • Read the module docs to identify data flow surfaces.
  • Read references/input-attack-patterns.md before scanning for each category.
  • Read tests and code evidence that could confirm or refute safe handling.

Procedure

  1. SSRF scan: Find all code paths that accept a URL, IP, or hostname and make an outbound request. Check for an explicit allowlist or blocked private-range validation (127.x, 10.x, 169.254.x, 172.16–31.x, ::1, fd00::/8, AWS metadata 169.254.169.254).

  2. IDOR scan: Find resource lookups keyed by a user-controlled ID. Verify an authorization check exists between ID resolution and data return, not just at the route level.

  3. Mass assignment scan: Find ORM fill calls, model constructors, or serializers that accept the full request body. Verify an explicit allowlist ($fillable, attr_accessible, schema.pick()) or blocklist exists.

  4. Injection vectors: Identify:

    • Raw SQL construction or string interpolation in queries
    • Shell exec with user input (exec, system, passthru, child_process.exec, subprocess.run(shell=True))
    • Template rendering with unsanitized data ({!! !!}, |raw, dangerouslySetInnerHTML, render_template_string)
    • Deserialization of untrusted data (unserialize(), pickle.loads(), yaml.load() without Loader=SafeLoader)
    • LDAP injection in directory lookups
    • XPath injection in XML processing
  5. File upload abuse: Check MIME type validation, file extension allowlist, path traversal in the filename, storage isolation from the web root, and max-file-size enforcement.

  6. Prototype pollution (JS/Node): Find deep merges of user input into objects without property filtering, lodash.merge, Object.assign, _.defaults from untrusted source with __proto__ or constructor.prototype keys.

  7. ReDoS: Find user input fed into regex patterns that could cause catastrophic backtracking. Look for patterns of the form (a+)+, (a|a)+, or .*.* applied to unbounded input.

Output Contract

  • Match assets/output.template.md: severity, WSTG id (from assets/wstg-mapping.txt), category, Evidence: file:line, Reproduction (endpoint + parameter + expected vs observed), Required action.
  • Output must pass scripts/lint-findings.sh (exit 0).

Escalate / Stop Conditions

  • Ask when module docs describe external integrations but do not name the parameters or protocol used.
  • Warn when deserialization of complex objects (PHP unserialize, Python pickle) is found without a safe alternative.
  • Do not flag a finding purely because a URL parameter exists: only when there is no evidence of safe handling.

Resources

  • references/input-attack-patterns.md
  • scripts/scan-injection-smells.sh: pre-investigation grep for known sinks
  • scripts/lint-findings.sh: enforces WSTG id + Evidence:file:line per finding
  • assets/output.template.md
  • assets/wstg-mapping.txt

04 同仓库更多 Skills

Eliyce
Eliyce/paqad-ai

sample-skill

Sample bundled skill fixture

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

understand-idea

Chat and Claude Code: Step 1 of the discover journey: clarifies the goal, who benefits, success and constraints into the idea block. Use when the journey directs it to step 1, not directly.

★ 8
Eliyce
Eliyce/paqad-ai

size-work

Chat and Claude Code: Suggest a size for a ticket from comparable finished work, as a labelled suggestion the team still owns. Use it when someone asks "how big is this?", "roughly how much work is ABC-12?", or wants a backlog item sized. It finds the team's sizing scale at first use, picks two to five of the closest finished tickets with links, and gives a size or range with the drivers behind it and a confidence of low, medium or high, lowered and explained when the area's documents are template text. Every result is labelled a suggested size, never a date or a commitment. It writes nothing into the size field unless the user says "set it", and it refuses to overwrite an existing size unless the user asks to replace it. Produces the sizing block of the record.

★ 8
Eliyce
Eliyce/paqad-ai

refine-ticket

Chat and Claude Code: Improve one or more existing tracker tickets without losing the author's intent. Use it when someone wants a ticket read, diagnosed and tidied up ("this ticket is vague", "fix up ABC-12", "split this, it's too big"). It reads each ticket in full and snapshots it with its last-updated time, says what is wrong with evidence, and proposes a field-by-field before and after change set limited to summary, description, labels, parent, links and new child tickets on a split. It writes nothing until an explicit "apply it" bound to that exact change set, re-checks the ticket for conflicting edits just before writing, never replaces rich descriptions with plain text, never deletes or closes a ticket, and reads each ticket back after applying. Produces the existing and changes blocks of the record.

★ 8