agentleFS
thejefflarsonthejefflarson/soundcheck/.claude/skills/prototype-pollution/SKILL.md

prototype-pollution

Skill20 starsChanged 4 months agoMITView on GitHub

Detects JavaScript deep-merges or property assignment from user input that can

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql-injection, command-injection and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • YepAPISkill

    sql-injection

    SQL injection prevention — parameterized queries, ORM safety, dynamic query guards.

    Also in 3 projects that use this

  • blacklanternsecuritySkill

    command-injection

    Guide OS command injection exploitation during authorized penetration testing.

    Also in 3 projects that use this

  • blacklanternsecuritySkill

    xxe

    Guide XML External Entity (XXE) injection exploitation during authorized penetration testing.

    Also in 3 projects that use this

  • SubhiSecSkill

    ssti

    Hunt Server-Side Template Injection (SSTI) in Jinja2, Twig, Freemarker, Velocity, Smarty, ERB, Handlebars, Mustache, and Spring (SpEL). Use when input is reflected in a way that suggests template rendering — error pages, email templates, PDF generators, dynamic content systems.

    Also in 3 projects that use this

  • SubhiSecSkill

    xss

    Hunt reflected, stored, and DOM-based Cross-Site Scripting (XSS) including CSP bypass, polyglot payloads, mutation XSS (mXSS), markdown XSS, and template XSS. Use when the user has identified a parameter or input that reflects to the page, or wants to test for XSS in a specific input.

    Also in 3 projects that use this

  • +1 more from SubhiSec

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When iterating source keys, use the own-keys iterator (e.g.

    line 48

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prototype Pollution Security Check (CWE-1321)

What this checks

Protects against prototype pollution in JavaScript/TypeScript where an attacker injects properties like __proto__ or constructor.prototype through user input, modifying the prototype chain of all objects. Exploitation leads to property injection, auth bypass, and remote code execution in some frameworks.

Vulnerable patterns

  • Deep merge of user input into a config or options object using a library helper that recurses through __proto__.
  • Object.assign or spread of a parsed JSON body into a target object — the __proto__ key is copied as a regular property and walked by the engine.
  • Custom recursive merge that iterates source keys with no filter — __proto__ and constructor.prototype are merged in alongside everything else.
  • Dynamic property assignment where both the key and the value come from user input, with no key validation.

Fix immediately

Flag the vulnerable code and explain the risk. Then suggest a fix that establishes these properties. The audited file is JavaScript or TypeScript by definition, so the principles translate directly — apply them using the project's existing utility library and module conventions.

  1. Any recursive merge, clone, or property copy on user input filters the dangerous keys — __proto__, constructor, prototype. The filter runs before assignment, not after; a post-hoc delete does not help because the prototype chain was already mutated.
  2. Dynamic property assignment from user input validates the key against a blocklist, or sidesteps the issue by using a Map. A Map has no prototype-chain exposure; object indexing does.
  3. Config and lookup objects use a null-prototype object when keys come from input. An object created with no prototype cannot be polluted because there is no prototype chain to reach.
  4. Library deep-merge helpers (_.merge, _.set, $.extend(true, …)) on untrusted input are replaced with key-filtered wrappers or safe alternatives. The issue is library-version-dependent, so relying on patched versions is fragile; filter at the call site.

When iterating source keys, use the own-keys iterator (e.g. Object.keys), never the prototype-walking variant.

Verification

  • No deep merge, clone, or recursive property copy on user-controlled input proceeds without filtering __proto__, constructor, and prototype keys
  • Dynamic property assignment from user input validates the key against a blocklist or uses Map instead
  • If a library deep-merge helper is used, it is replaced or wrapped with a key filter before being applied to untrusted input
  • Iteration uses an own-keys iterator, not a prototype-walking one

References

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.