How a Single Unauthenticated GraphQL Request Compromised Mozilla Firefox CI — $12,000 Bounty
An unauthenticated GraphQL endpoint accepted a free-form JSON filter that was passed to the sift library, which evaluated a $where string as JavaScript. An attacker could run arbitrary code in the Node.js process and steal credentials and tokens.
Published on medium.com
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Mozilla's Firefox CI is built and tested through Taskcluster, and the component at the centre of this write-up is the Taskcluster web-server. That server exposes a public /graphql endpoint, and the report describes it as the core infrastructure responsible for building and testing Firefox CI.
The vulnerability is a remote code execution flaw in that web-server. The report states that no authentication, tokens or special HTTP headers were needed: a single HTTP POST request to the public /graphql endpoint was enough to execute arbitrary JavaScript inside the Node.js process.

Setup
The report does not describe any account, role or tooling used by the researcher. The only precondition it names is on the target side: the GraphQL endpoint accepted anonymous callers, and the anonymous role held sufficient default scopes for the relevant query resolver to run normally. The vulnerable dependency is identified as sift version 17.1.3.
Finding it
The report presents the issue as a root cause chain rather than describing the moment of discovery. The chain has four links:
- Free-form JSON input. The public
/graphqlendpoint accepted an open, arbitraryJSONscalar object as a queryfilterargument. - Unsanitised filtering with
sift. The server forwarded this raw JSON input directly into thesiftlibrary, a MongoDB-like query builder for JavaScript, without stripping or validating operators. - Code evaluation via
$where. Insift17.1.3, passing a$wherecondition compiles the provided string into an executable JavaScript function usingnew Function(). - Anonymous execution path. Because the
anonymousrole held sufficient default scopes, the query resolver executed normally, passing the filter intosiftand triggering the malicious JavaScript.
Each link is individually plausible in a GraphQL service that accepts structured filters; together they turn a query argument into a code execution primitive.
Exploitation
Step 1: Send an unauthenticated GraphQL request
The report does not reproduce the exact request body. It states only that the attack is a single HTTP POST to the public /graphql endpoint, carrying a query whose filter argument is an arbitrary JSON scalar object, and that the object contains a $where condition whose string value is compiled by sift into a function via new Function().
The important parts, as described:
- The request needs no authentication, no token and no special headers.
- The
filterargument is typed as a genericJSONscalar, so the server accepts an open object rather than a fixed set of fields. - The
$wherekey inside that object is not stripped before the value reachessift. sift17.1.3 turns the$wherestring into executable JavaScript.
Step 2: Code runs in the Node.js process
Because the filter is evaluated inside the host's Node.js process, the injected JavaScript runs with the privileges of the web-server. From there the report says an attacker could execute arbitrary shell commands and extract all environment variables.
Step 3: Harvest credentials from the environment
The report lists what the environment exposure led to:
- Database credentials: full PostgreSQL credentials,
READ_DB_URLandWRITE_DB_URL. - Deployment access tokens: exfiltration of
TASKCLUSTER_ACCESS_TOKEN, granting control over the entire Taskcluster deployment. - OAuth client secrets: client secrets for the Auth0 and GitHub integrations.
- Database encryption and session keys: column encryption keys and
SESSION_SECRET, which the report says was set to the default valueFIXME.
Root cause
The mistake is a composition of design and dependency behaviour. On the application side, the GraphQL schema exposed a generic JSON scalar for the filter argument, so any object shape was accepted, and the server passed that object to sift without removing operator keys beginning with $. On the dependency side, sift 17.1.3 treats a $where condition as code: it compiles the supplied string with new Function().
The existing defences did not stop the chain. The report says the endpoint allowed anonymous callers and that the anonymous role held sufficient default scopes for the resolver to execute, so authorisation did not act as a barrier. Input validation did not strip the $ operators, and the dependency performed dynamic code evaluation on untrusted input. The report also notes that SESSION_SECRET was set to a default value, FIXME.
Impact
The report describes the outcome as a total cluster compromise. Under the conditions it states, an unauthenticated attacker could:
- execute arbitrary JavaScript in the web-server's Node.js process;
- run arbitrary shell commands on the host;
- read all environment variables, including the PostgreSQL read and write URLs, the Taskcluster access token, Auth0 and GitHub OAuth client secrets, column encryption keys and the session secret;
- use
TASKCLUSTER_ACCESS_TOKENto take control of the entire Taskcluster deployment.
The report does not give a CVSS score or a severity rating.
Fix
The recommended measures are:
- Sanitise dynamic queries: never pass raw, free-form JSON objects directly to query engines like
siftwithout stripping operator keys starting with$. - Use strict input schemas: avoid generic
JSONscalar types in GraphQL endpoints; define explicit input types with allowlisted fields instead. - Disable dynamic code evaluation: ensure third-party dependencies do not evaluate untrusted input via
eval()ornew Function(). - Credential hygiene: ensure production environments never use placeholder or default secret values, such as
SESSION_SECRET=FIXME.
Variants to test
- Generic JSON scalars in GraphQL filters. Look for arguments typed as a free-form
JSONscalar that are forwarded to a query engine. A positive result is that an operator key such as$wheresurvives into the engine and causes evaluation. sift-style query builders in Node.js services. Identify services that usesiftor similar MongoDB-like matchers on user input. A positive result is that a$wherestring is compiled and executed rather than rejected.- Anonymous roles with default scopes. Enumerate resolvers reachable without authentication and check whether the anonymous role's scopes permit execution. A positive result is a resolver that runs a sensitive query for an unauthenticated caller.
- Environment variable exposure after code execution. Where any evaluation primitive is found, check whether the process environment contains database URLs, deployment tokens or OAuth secrets. A positive result is readable credentials in the process environment.
- Placeholder secrets in production. Search configuration for default values such as
FIXME. A positive result is a production deployment using a documented placeholder for a session or encryption key.
What happened, in plain words
Mozilla builds and tests the Firefox browser using a system called Taskcluster. You can think of Taskcluster as a large factory: it takes in pieces of work (compile this, run that test), hands them out to machines, and collects the results. One part of that factory is the Taskcluster web-server, a program that listens for requests coming in over the internet and answers them.
That web-server had a serious flaw. A person sitting anywhere on the internet, with no account, no password and no special permission, could send it one single message and make it run code of their choosing. In security language this is called remote code execution, or RCE: "remote" because the attacker is not sitting at the machine, "code execution" because the attacker's instructions actually run on the victim's computer.
The report describes the flaw as a chain of four small mistakes that, added together, let a harmless-looking query turn into running commands. The attacker could then read the server's secrets, including database passwords and a token that controls the whole Taskcluster deployment. The title of the report puts the bounty at $12,000.

Some background before we start
A few everyday ideas will make the rest of this easier.
- A server is a computer that waits for requests and answers them. When you load a web page, your browser is the client and the machine sending the page is the server.
- An API is the way one program talks to another. Think of a restaurant: you do not walk into the kitchen, you give your order to a waiter, and the waiter brings back food. An API is the waiter. You send a structured request, you get a structured answer.
- HTTP is the language browsers and servers use to exchange those requests. A
GETrequest usually means "give me this page". APOSTrequest usually means "here is some data, do something with it". - GraphQL is a style of API where the client sends a query describing exactly what it wants, and the server answers with exactly that shape of data. Instead of many separate addresses (one per thing), there is usually one address, here
/graphql, and the query itself says what to fetch. - A token is a short string that proves who you are, like a wristband at an event. If you have the wristband, you get in. If a token leaks, whoever holds it can pretend to be you.
- Authentication means proving who you are. Authorisation means deciding what you are allowed to do once you have proved it. A public endpoint that needs no proof of identity is called unauthenticated or anonymous.
- Node.js is a program that runs JavaScript outside the browser, typically on servers. When we say code runs "in the Node.js process", we mean it runs inside that server program, with whatever powers that program has.
- An environment variable is a named setting a program reads when it starts, such as a database address or a password. They are convenient, and they are also a favourite target for attackers, because one program's settings often include its most sensitive secrets.
With those in hand, the story is easier to follow.
The setup
The report does not describe any account, role or tooling the researcher used. The only precondition it names is on the target side: the GraphQL endpoint accepted anonymous callers, and the anonymous role held sufficient default scopes for the relevant query resolver to run normally. The vulnerable dependency is identified as sift version 17.1.3.
Two of those words need unpacking.
- A role is a label that says what a caller is allowed to do. "Anonymous" is the role given to someone who has not logged in. Scopes are the individual permissions attached to a role, like a list of doors a key opens. If the anonymous role's list of doors happens to include a sensitive one, then anyone off the street can walk through it.
- A dependency is a piece of code written by someone else that your program includes and relies on. Most modern software is mostly dependencies.
siftis one: a small library that lets JavaScript programs filter lists of objects using a query syntax borrowed from MongoDB, a popular database.
Finding it
The report presents the issue as a root cause chain rather than describing the moment of discovery. The chain has four links:
- Free-form JSON input. The public
/graphqlendpoint accepted an open, arbitraryJSONscalar object as a queryfilterargument. - Unsanitised filtering with
sift. The server forwarded this raw JSON input directly into thesiftlibrary, a MongoDB-like query builder for JavaScript, without stripping or validating operators. - Code evaluation via
$where. Insift17.1.3, passing a$wherecondition compiles the provided string into an executable JavaScript function usingnew Function(). - Anonymous execution path. Because the
anonymousrole held sufficient default scopes, the query resolver executed normally, passing the filter intosiftand triggering the malicious JavaScript.
Each link is individually plausible in a GraphQL service that accepts structured filters; together they turn a query argument into a code execution primitive.
Let us walk through the chain slowly, because each link is a concept worth knowing.
Link 1: free-form JSON input. JSON is a simple text format for structured data, made of objects (curly braces with named fields) and values. When a GraphQL endpoint declares an argument as a generic JSON scalar, it is saying "send me any object shape you like, I will not check the fields". That is convenient for developers and dangerous for security, because the server has no list of allowed field names to compare against. A scalar here just means a single value type rather than a complex structured type with a fixed schema.
Link 2: unsanitised filtering with sift. Sanitising input means cleaning it before use: removing or rejecting anything that should not be there. Here the server took the raw object from the request and handed it straight to sift. sift understands special keys that begin with a dollar sign, called operators, which change how a filter behaves. Because nothing stripped those keys, the attacker could use them.
Link 3: code evaluation via $where. The $where operator is the dangerous one. In sift 17.1.3, the string you give to $where is not treated as data; it is turned into a real JavaScript function with new Function(). new Function() is a JavaScript feature that builds a function from a piece of text at runtime. If that text comes from an attacker, the attacker is effectively writing code that your server will run. This is the same family of risk as eval(), which does much the same thing.
Link 4: anonymous execution path. Even a perfect exploit needs the code to actually be reached. The report says the endpoint allowed anonymous callers and that the anonymous role had enough scopes for the resolver to run. A resolver is the part of a GraphQL server that produces the answer for a particular query field. So the request was not blocked at the door: it reached the code that passed the filter into sift.
Exploitation
Step 1: Send an unauthenticated GraphQL request
The report does not reproduce the exact request body. It states only that the attack is a single HTTP POST to the public /graphql endpoint, carrying a query whose filter argument is an arbitrary JSON scalar object, and that the object contains a $where condition whose string value is compiled by sift into a function via new Function().
The important parts, as described:
- The request needs no authentication, no token and no special headers.
- The
filterargument is typed as a genericJSONscalar, so the server accepts an open object rather than a fixed set of fields. - The
$wherekey inside that object is not stripped before the value reachessift. sift17.1.3 turns the$wherestring into executable JavaScript.
Why does this matter so much? Because each of those four points removes one of the barriers that would normally stop an attack. No login means no identity to check. A generic JSON type means no field allowlist to reject the odd key. No stripping means the $where operator survives the journey. And the library's own behaviour turns that operator into running code. Remove any one link and the chain breaks; together they hold.
Step 2: Code runs in the Node.js process
Because the filter is evaluated inside the host's Node.js process, the injected JavaScript runs with the privileges of the web-server. From there the report says an attacker could execute arbitrary shell commands and extract all environment variables.
A shell command is an instruction given to the operating system, the same kind of thing you would type in a terminal. If an attacker can run shell commands, they are no longer limited to what the web application was designed to do; they can do anything the server's user account can do. And because environment variables are readable from inside the process, the attacker can simply ask the server for its own secrets.
Step 3: Harvest credentials from the environment
The report lists what the environment exposure led to:
- Database credentials: full PostgreSQL credentials,
READ_DB_URLandWRITE_DB_URL. - Deployment access tokens: exfiltration of
TASKCLUSTER_ACCESS_TOKEN, granting control over the entire Taskcluster deployment. - OAuth client secrets: client secrets for the Auth0 and GitHub integrations.
- Database encryption and session keys: column encryption keys and
SESSION_SECRET, which the report says was set to the default valueFIXME.
A few of those deserve a plain explanation.
- PostgreSQL is a widely used database. A connection URL is a single string containing the address, the username and the password needed to reach it.
READ_DB_URLandWRITE_DB_URLare the read and write connection strings. With them, an attacker can read or alter the data directly, bypassing the application entirely. - Exfiltration simply means getting data out of the victim's system and into the attacker's hands.
- OAuth is the system behind "Log in with GitHub" style buttons. An OAuth client secret is the password that a service uses to prove to GitHub or Auth0 that it really is that service. Leaking it can let an attacker impersonate the integration.
- A session secret is the key a web application uses to sign the cookies that keep you logged in. If someone knows it, they can forge a valid session and pretend to be another user. The report notes this one was left at the placeholder value
FIXME, which is like leaving the factory default password on a lock.
Root cause
The mistake is a composition of design and dependency behaviour. On the application side, the GraphQL schema exposed a generic JSON scalar for the filter argument, so any object shape was accepted, and the server passed that object to sift without removing operator keys beginning with $. On the dependency side, sift 17.1.3 treats a $where condition as code: it compiles the supplied string with new Function().
The existing defences did not stop the chain. The report says the endpoint allowed anonymous callers and that the anonymous role held sufficient default scopes for the resolver to execute, so authorisation did not act as a barrier. Input validation did not strip the $ operators, and the dependency performed dynamic code evaluation on untrusted input. The report also notes that SESSION_SECRET was set to a default value, FIXME.
In plain terms: the application trusted its input too much, the library trusted its input too much, and the permission system was too generous. Any one of those being stricter would have broken the chain.
Impact
The report describes the outcome as a total cluster compromise. A cluster here means the group of machines and services that together run Taskcluster. Under the conditions it states, an unauthenticated attacker could:
- execute arbitrary JavaScript in the web-server's Node.js process;
- run arbitrary shell commands on the host;
- read all environment variables, including the PostgreSQL read and write URLs, the Taskcluster access token, Auth0 and GitHub OAuth client secrets, column encryption keys and the session secret;
- use
TASKCLUSTER_ACCESS_TOKENto take control of the entire Taskcluster deployment.
The report does not give a CVSS score or a severity rating.
Fix
The recommended measures are:
- Sanitise dynamic queries: never pass raw, free-form JSON objects directly to query engines like
siftwithout stripping operator keys starting with$. - Use strict input schemas: avoid generic
JSONscalar types in GraphQL endpoints; define explicit input types with allowlisted fields instead. - Disable dynamic code evaluation: ensure third-party dependencies do not evaluate untrusted input via
eval()ornew Function(). - Credential hygiene: ensure production environments never use placeholder or default secret values, such as
SESSION_SECRET=FIXME.
An allowlist is the opposite of a blocklist: instead of trying to name everything bad and forbid it, you name everything good and permit only that. It is far harder to get wrong, because anything unexpected is rejected by default.
Variants to test
- Generic JSON scalars in GraphQL filters. Look for arguments typed as a free-form
JSONscalar that are forwarded to a query engine. A positive result is that an operator key such as$wheresurvives into the engine and causes evaluation. sift-style query builders in Node.js services. Identify services that usesiftor similar MongoDB-like matchers on user input. A positive result is that a$wherestring is compiled and executed rather than rejected.- Anonymous roles with default scopes. Enumerate resolvers reachable without authentication and check whether the anonymous role's scopes permit execution. A positive result is a resolver that runs a sensitive query for an unauthenticated caller.
- Environment variable exposure after code execution. Where any evaluation primitive is found, check whether the process environment contains database URLs, deployment tokens or OAuth secrets. A positive result is readable credentials in the process environment.
- Placeholder secrets in production. Search configuration for default values such as
FIXME. A positive result is a production deployment using a placeholder for a session key.
Two terms in that list are worth defining. A timing difference means the response takes noticeably longer when the injected code runs, which is a clue that something executed. An out-of-band callback means the injected code makes the server contact a machine the researcher controls, which proves execution without needing a visible answer in the response.
Glossary
- API: the agreed way for one program to ask another for data or actions, like a waiter taking your order to the kitchen.
- Authentication: proving who you are, usually with a password or token.
- Authorisation: deciding what an identified caller is allowed to do.
- Anonymous: a caller who has not identified themselves.
- Role: a label grouping a set of permissions.
- Scope: one individual permission attached to a role.
- GraphQL: an API style where the client sends a query describing the exact data it wants.
- Resolver: the part of a GraphQL server that produces the answer for a query field.
- Endpoint: a specific address on a server that accepts requests, here
/graphql. - HTTP: the protocol browsers and servers use to exchange requests and responses.
- POST: an HTTP request type used to send data to the server.
- Header: extra information attached to an HTTP request, such as the format of the body.
- JSON: a text format for structured data made of objects and values.
- Scalar: a single simple value type, as opposed to a structured type with fixed fields.
- Schema: the definition of what a GraphQL API accepts and returns.
- Allowlist: a list of things explicitly permitted, with everything else rejected.
- Sanitise: clean input before using it, removing anything that should not be there.
- Operator: a special key, often starting with
$, that changes how a query filter behaves. sift: a JavaScript library that filters lists of objects using MongoDB-like query syntax.- MongoDB: a popular database whose query syntax
siftimitates. $where: a filter operator that evaluates a supplied string as code.new Function(): a JavaScript feature that builds a function from text at runtime.eval(): a JavaScript feature that runs a string as code.- Dynamic code evaluation: running code that was produced at runtime, often from input, rather than written in advance.
- Remote code execution (RCE): a flaw that lets an attacker run their own code on someone else's machine over a network.
- Node.js: a program that runs JavaScript outside the browser, commonly on servers.
- Process: a running instance of a program, with its own memory and permissions.
- Environment variable: a named setting a program reads at startup, often holding configuration and secrets.
- Shell command: an instruction given to the operating system, as typed in a terminal.
- Exfiltration: getting data out of a victim's system and into an attacker's hands.
- PostgreSQL: a widely used relational database.
- Connection URL: a single string containing the address, username and password needed to reach a database.
- OAuth: the system behind "Log in with" buttons, letting services prove identity to each other.
- OAuth client secret: the password a service uses to prove its identity to an OAuth provider.
- Session secret: the key used to sign login cookies, so that sessions cannot be forged.
- Cookie: a small piece of data a site stores in your browser to remember you between requests.
- Token: a string that proves identity or grants access, like a wristband at an event.
- Cluster: a group of machines and services working together as one system.
- Dependency: code written by someone else that your program includes and relies on.
- CVSS: a standard scoring system for rating the severity of a vulnerability.
- Timing difference: a measurable change in how long a response takes, used as a clue that injected code ran.
- Out-of-band callback: a connection the injected code makes to a machine the researcher controls, proving execution.