nosql-injection
Skill20 starsChanged 4 months agoMITView on GitHub
Detects MongoDB and other NoSQL queries that mix user input into operators or
7 other projects use a version of this.
Adopted by
Most recently taken up by
- blacklanternsecurity/red-runtheir own version, first seen Oct 25, 2026
- emre-guler/websectheir own version, first seen Aug 27, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- KaanBicaklar/mona-sast-skillstheir own version, first seen Jul 9, 2026
- langbyyi/websec-skillstheir own version, first seen Jun 12, 2026
- JustineDevs/premortemtheir own version, first seen Jun 9, 2026
Used with
Projects with it also use recon-and-methodology, type-juggling 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.
yaklangSkillrecon-and-methodology
Reconnaissance and methodology playbook. Use when mapping assets, discovering endpoints, fingerprinting technology, and building a structured testing plan for a new target.
Also in 3 projects that use this
yaklangSkilltype-juggling
PHP type juggling and weak comparison (`==`) bypass. Use when authentication, HMAC/signature checks, or token validation uses loose equality, numeric coercion, or hash comparisons without strict types — common in legacy PHP and CTF-style code paths.
Also in 3 projects that use this
SubhiSecSkillssti
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
SubhiSecSkillbusiness-logic
Hunt business logic flaws — race conditions, workflow state bypass, parameter pollution affecting logic, coupon/discount abuse, refund logic, multi-step process bypass, integer overflow, negative quantities, double-spend. Use when looking for non-CVE bugs that require understanding the app's intended workflow.
Also in 3 projects that use this
- +2 more from yaklang
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- yaklang/hack-skills★ 2.4ksame name
- blacklanternsecurity/red-run★ 296same name
- langbyyi/websec-skills★ 4same name
- emre-guler/websec★ 2same name
- JustineDevs/premortem★ 2same name
- KaanBicaklar/mona-sast-skills★ 2same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- authentication-failuresSkill
- broken-access-controlSkill
- concurrency-correctnessSkill
- contract-reviewSkill
- cryptographic-failuresSkill
- crypto-library-misuseSkill
- csrfSkill
- exceptional-conditionsSkill
- excessive-agencySkill
- file-uploadSkill
- graphql-securitySkill
- hardcoded-secretsSkill
- header-injectionSkill
- hotspotsSkill
- injectionSkill
- insecure-designSkill
- insecure-local-storageSkill
- insecure-output-handlingSkill
- insecure-plugin-designSkill
- integrity-failuresSkill
- ipc-securitySkill
- llm-supply-chainSkill
- logging-failuresSkill
- mass-assignmentSkill
- mcp-securitySkill
- memory-api-misuseSkill
- model-dosSkill
- model-theftSkill
- multi-agent-trustSkill
- numeric-trust-boundarySkill
- oauth-implementationSkill
- open-redirectSkill
- overrelianceSkill
- path-traversalSkill
- privilege-handlingSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- pr-reviewSkill
- race-conditionSkill
- rag-securitySkill
- redosSkill
- security-cleanupSkill
- security-misconfigurationSkill
- security-reviewSkill
- sensitive-disclosureSkill
- ssrfSkill
- supply-chainSkill
- threat-modelSkill
- token-smugglingSkill
- training-data-poisoningSkill
- unsafe-api-consumptionSkill
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 7 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
- Very specific: line 22
Use of $where, $expr, or $function with a string that incorporates user input
“Common” is measured: kept by at least 6 in 10 of the 7 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.
Files
NoSQL Injection Security Check (CWE-943)
What this checks
Protects against NoSQL injection where user input manipulates query operators or
structure. Unlike SQL injection, NoSQL injection exploits operator injection
($gt, $ne, $regex) and JavaScript execution in database engines. Exploitation
leads to authentication bypass, data exfiltration, and denial of service.
Vulnerable patterns
- Query filter built by passing a deserialized request body or query object straight into the database client, letting the caller smuggle operators in place of values
- Use of
$where,$expr, or$functionwith a string that incorporates user input - Filter value that is allowed to be an object or array when the schema expects a primitive, enabling operator injection like a not-equal match against a credential field
- Aggregation pipeline stage built from raw caller-supplied data with no field allowlist
Fix immediately
Flag the vulnerable code and explain the risk. Then suggest a fix that establishes these properties:
- Every value destined for a query filter is type-checked as a primitive. Reject anything that is not a string, number, or boolean before it reaches the query builder. The classic not-equal-empty-string auth bypass works because the deserialized payload was allowed to be an object; enforcing a primitive type turns operator keys into literal values that cannot match.
- Server-side evaluation operators never receive user-supplied values.
Operators like
$where,$expr, and$functionaccept JavaScript or expression strings that the database engine evaluates; with user input in them, the database becomes an interpreter running attacker code. - Raw request bodies and query objects are not passed directly as filters.
Build the query object explicitly from validated, named fields — the same
allowlist discipline that defeats mass assignment (see the
mass-assignmentskill for ORM-side details).
Translate these principles to the NoSQL client library and validator of the audited file. Use the driver's documented parameterization or query-builder API — do not build filters from untyped caller-supplied objects.
Verification
- Every value in a NoSQL query filter derived from user input is explicitly type-checked as a primitive (string, number) — not an object or array that could contain query operators
$where,$expr, and$functionare never used with user-supplied values- Raw request bodies or query parameters are never passed directly as database query filters
References
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
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.

