Individual skill

api-mongo-agg-facet-bypass

Bypass a MongoDB aggregation-pipeline stage allowlist by nesting disallowed read stages inside $facet, then $unionWith/$lookup sibling collections to exfiltrate secrets (invite tokens, creds, hashes). Load when: an endpoint accepts a user-supplied `pipeline` (or errors like "operator-form queries not accepted, use the pipeline parameter"), a Node/Express + MongoDB backend, 24-hex `_id`s, or an "advanced query" API. Authorized targets only.

skills/api/api-mongo-agg-facet-bypass/SKILL.md

Read pinned source

Source commit ee0e0c50d2f6d941a14b73dd85a2b470d0ab976e

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
No
Skill scan complete
Yes
Observed behavior
Not checked yet
Last checked
Nov 11, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
27
Repository last updated
Oct 14, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# MongoDB aggregation injection — $facet allowlist bypass → cross-collection read

## When it applies
- An API runs a user-controlled **aggregation pipeline** on a fixed collection
  (`db.collection('x').aggregate(userPipeline)`), usually exposed as a `pipeline`
  query/body parameter for "advanced" search.
- The server defends with a **stage allowlist** — only screens the *top-level* stage
  names (`$match/$project/$sort/$limit/$facet` allowed; `$lookup/$unionWith/$group/…`
  rejected with something like `"invalid or disallowed pipeline stage"`).
- Tell-tale that a `pipeline` param even exists: sending the normal search term as a
  Mongo **operator object** (`?q[$ne]=x`) returns a hint such as
  `"Operator-form queries not accepted on 'q'. Use the 'pipeline' parameter…"`.

## Why it works
Back to top