Skip to content
DoS Write-up Intermediate

Turning a GraphQL Aliasing Quirk into a Fully Reproducible Denial-of-Service Attack

The GraphQL API allowed the same password-reset mutation to be repeated many times in one HTTP request using aliases, and each alias ran as a separate server-side operation. An unauthenticated attacker could send a single request with enough aliases to exceed the upstream timeout and cause the endpoint to return 503 Service Unavailable.

Ahmed Mahmoud Follow

Published on medium.com

Cybersecurity

Ahmed Mahmoud, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is New Balance's website, and specifically its "Forgot Password" flow. That flow is backed by a GraphQL API, and the operation that sends the reset email is the commerce_requestPasswordResetEmail mutation. Normally a client sends this mutation once, the server resolves it once, and a single password-reset email is dispatched to the supplied address.

GraphQL also lets a client request the same field or mutation several times inside one operation, provided each instance carries a unique alias. This is a documented feature: it exists so a client can fetch or mutate several distinct resources in one round trip. The researcher's starting question was not "is this a vulnerability" but something narrower: what happens if the same mutation is aliased repeatedly instead of aliasing different ones?

The finding was accepted on Bugcrowd with a P2 classification.

From the original on medium.com

Setup

The outage was reproduced as an unauthenticated user, since the endpoint required no login. The endpoint required no login, which matters later: there was no per-account rate limit to slow the attack down.

The main tool was Burp Suite, used to intercept the normal password-reset request. No special accounts or roles were needed, and the report gives no software versions.

Finding it

Intercepting the ordinary reset request showed nothing unusual on the surface: a POST /graphql request carrying the commerce_requestPasswordResetEmail mutation, completing in roughly 376 ms.

At that point there was no specific denial-of-service hypothesis. The question was whether the API validated how a mutation was structured, or only what it contained. Aliasing was the natural thing to try, because it quietly extends what a single request can do, and APIs do not always account for that.

Exploitation

Step 1: the baseline request

The normal request is a POST /graphql carrying the mutation, and it completes in about 376 ms.

Step 2: five aliases, then ten and fifteen

The first probe sent five aliases of the same mutation, all pointing at the same email address. The shape is the one GraphQL permits for any repeated field:

GraphQL
mutation {  r1: commerce_requestPasswordResetEmail(email: "[redacted]")  r2: commerce_requestPasswordResetEmail(email: "[redacted]")  r3: commerce_requestPasswordResetEmail(email: "[redacted]")}

Each r1, r2, r3 is an alias, so the server sees three independent selections of the same mutation in one document. The response time for five aliases was about 1,307 ms. A single data point proves nothing, so the test was repeated at 10 and 15 aliases:

Aliases Response time
1 ~376 ms
5 ~1,307 ms
10 ~2,313 ms
15 ~3,553 ms

The numbers climbed in a way that did not look random. That shifted the thinking from "that is slower" to "this may scale predictably, and if it does, the finding can be made much stronger."

Step 3: turning the hunch into a model

Rather than just describing the delay, the researcher treated it as a cost function:

Text
response_time ≈ base_time + (aliases × cost_per_alias)

Fitting the four measured points gives a base time of roughly 150 to 200 ms and a cost per alias of roughly 220 to 230 ms, and the fit is close to perfectly linear across every point measured.

Linearity was the point. A linear, unbounded cost function has no ceiling, so if the model held there had to exist some alias count n large enough that the response time would exceed whatever timeout sat upstream of the service. Predicting n mathematically means going straight at the failure instead of stumbling onto it.

Step 4: testing the prediction

Using the model, the next test used 100 aliases, expecting it to land well past the breaking point. The result matched the model:

  • Response time: about 15,838 ms
  • Result: HTTP/2 503 Service Unavailable
  • Upstream response: first byte timeout

Up to this point everything had been "slower than before". This was the server refusing to answer at all, which is the line between elevated latency and an actual denial of service.

Step 5: confirming real execution

The obvious follow-up was whether the server was really running the mutation 100 times, or merely spending time parsing a large document without doing anything meaningful per alias. If it were the latter, the finding would be much weaker: a parsing cost issue rather than a business-logic execution issue.

To settle it, a single request with 50 aliases of the mutation was sent, all pointing at an email address the researcher controlled, and the inbox was watched. Fifty separate password-reset emails arrived, one per alias. Each alias was not merely counted or parsed; it was fully executed as its own independent operation with its own side effect.

Root cause

The GraphQL server resolved every alias as a fully independent server-side operation. There was no batching, no deduplication and no cost limiting. Because the cost of each alias is paid in full and the total grows linearly with alias count, a single HTTP request can be made arbitrarily expensive until it exceeds the upstream first-byte timeout and the endpoint returns 503 Service Unavailable.

Existing defences did not stop it because they were aimed at the wrong unit. Request-count-based defences see one HTTP request, and the endpoint required no login, so the usual friction of per-account rate limits was absent.

Impact

  • Single-request amplification. One HTTP request produces the full effect. This is not a volumetric, many-requests attack, which is exactly what makes it easy to miss with request-count-based defences.
  • Resource exhaustion. Each alias independently consumes backend CPU cycles and thread allocation on the password-reset resolver.
  • Availability impact. Sustained exploitation could deny password-reset functionality to legitimate users, and potentially degrade other operations sharing the same backend resources.

The 503 was reached as an unauthenticated user once the alias count pushed the response past the upstream timeout.

Fix

The report gives remediation guidance rather than describing a change that was made:

  1. Cap the number of aliases allowed per operation. Most GraphQL servers and gateways support this natively.

  2. Enforce query cost analysis, not just query depth limits: assign a computational cost to each field and mutation and reject requests that exceed a budget.

  3. Rate-limit at the operation level, not just the HTTP-request level, since a single HTTP request can contain many logical operations.

  4. Apply the same scrutiny to unauthenticated mutations as to authenticated ones. This endpoint required no login, which removed the usual friction of per-account rate limits.

  5. Alias the same mutation on other unauthenticated flows. Password reset, email verification, signup and contact forms are good candidates. A positive result is response time that grows linearly with alias count, followed by a timeout or 503 at a predictable count.

  6. Confirm real execution with a side effect you control. Point every alias at an address or account you own and count what arrives. A positive result is one side effect per alias, which rules out a pure parsing cost.

  7. Fit the cost model before pushing hard. Measure at a few small alias counts, fit base_time + aliases × cost_per_alias, and predict the count that should exceed the upstream timeout. A positive result is the predicted count producing the failure.

  8. Try aliasing expensive queries as well as mutations. Any resolver that does real work per invocation is a candidate. A positive result is the same linear growth in response time.

  9. Check whether depth limits alone are enforced. Send a shallow document with many aliases. A positive result is acceptance of a document that a depth limit would never catch.

  10. Test authenticated endpoints for per-account limits. If a limit exists, check whether it counts HTTP requests or logical operations. A positive result is many operations slipping through under one request.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

New Balance is a shoe and clothing company, and its website has a "Forgot Password" button. You click it, type your email address, and the site sends you an email with a link to set a new password. That is a normal, everyday feature.

Behind that button sits a piece of software called an API. An API is the part of a website that the page talks to when it needs something done: the page says "send a reset email to this address", and the API does it. You never see the API directly; your browser talks to it on your behalf.

Ahmed Mahmoud was testing that feature and reported the finding on Bugcrowd. A bug bounty programme is a scheme where a company invites outside testers to look for security problems and pays them for reporting what they find. He discovered that the API would happily do the same job many times over inside a single request, if you asked it in a particular way. Ask it enough times in one go, and the server becomes so busy that it stops answering anyone at all. That is a denial-of-service attack: not stealing data, but making a service unavailable.

The finding was accepted on Bugcrowd, a bug bounty platform, with a P2 classification. The finding was accepted on Bugcrowd with a P2 classification.

From the original on medium.com

Background: what is mutation aliasing?

Before the attack makes sense, you need two ideas: what a mutation is, and what an alias is.

In GraphQL, a way of asking an API for things that uses a single structured request, there are two kinds of operation. A query asks for information, like "what is the price of this shoe?". A mutation asks the server to change something, like "send a password reset email". The name is literal: a mutation mutates, it makes something happen.

An alias is simply a nickname you give to a piece of a request. GraphQL lets you ask for the same thing several times in one request, as long as each copy has its own unique nickname, so the server can tell the answers apart. Think of a shopping list where you write "milk (for breakfast)" and "milk (for the office)": same item, two entries, each labelled so you know which is which.

Here is what that looks like in a real request:

GraphQL
mutation {  r1: commerce_requestPasswordResetEmail(email: "[redacted]")  r2: commerce_requestPasswordResetEmail(email: "[redacted]")  r3: commerce_requestPasswordResetEmail(email: "[redacted]")}

Line by line:

  • mutation { opens a request that asks the server to do something, rather than just read something.
  • r1: is the alias, the nickname. It labels the first copy of the operation.
  • commerce_requestPasswordResetEmail(email: "[redacted]") is the operation itself: "send a password reset email to this address". The address here is a placeholder used in the write-up.
  • r2: and r3: are two more nicknames, each followed by the exact same operation.
  • The closing } ends the request.

So this one request asks the server to send three password reset emails to the same address. That is a legitimate, documented feature of GraphQL. It exists so a client can do several different things in one round trip, saving time. Nothing about it is inherently dangerous.

The question that started the investigation was not "is this a vulnerability". It was much narrower: what happens if you alias the same mutation over and over, instead of aliasing different ones? Most APIs are built assuming you will use the feature the sensible way, and they may not have thought about the other way.

Step 1: poking at the password-reset flow

The first step was simply to watch the normal request. The tool used was Burp Suite, a program that sits between your browser and a website and lets you see and edit everything that passes between them. Think of it as a transparent envelope you can open, read, and reseal before it reaches the recipient.

Intercepting the ordinary reset request showed nothing unusual on the surface: a POST /graphql request carrying the commerce_requestPasswordResetEmail mutation, completing in roughly 376 milliseconds.

What that means in plain words:

  • POST is one of the standard ways a browser talks to a server. It means "here is some data, please act on it", as opposed to GET, which means "please give me something".
  • /graphql is the address, or path, on the server that handles these requests. Every GraphQL request to this site goes to that one door.
  • The mutation inside is the actual instruction: send a reset email.
  • 376 milliseconds is a bit over a third of a second. That is the normal, healthy speed for this operation.

At that point there was no specific denial-of-service hypothesis. The question was whether the API checked how a request was structured, or only what it contained. Aliasing was the natural thing to try, because it quietly extends what a single request can do, and APIs do not always account for that. It is a bit like a form that checks you filled in the right boxes but never checks how many copies of the form you stapled together.

Step 2: the first sign something was off

The first probe sent five aliases of the same mutation, all pointing at the same email address.

The response time for five aliases was about 1,307 milliseconds. A single data point proves nothing, though: plenty of things add delay for harmless reasons, like a slow network moment or a server having a busy second. So the test was repeated at 10 and 15 aliases:

Aliases Response time
1 ~376 ms
5 ~1,307 ms
10 ~2,313 ms
15 ~3,553 ms

The numbers climbed in a way that did not look random. Each extra alias added a roughly consistent amount of time. That shifted the thinking from "that is slower" to "this may scale predictably, and if it does, the finding can be made much stronger". A predictable slowdown is far more convincing than a vague one, because you can use it to predict what happens next.

Step 3: turning the hunch into a model

This is the step that matters most, and the one easiest to skip if you are in a hurry to write a report. Rather than just describing the delay, the researcher treated it as a cost function: a formula describing how much time the server spends for a given amount of work.

Text
response_time ≈ base_time + (aliases × cost_per_alias)

Line by line:

  • response_time is how long the server takes to answer, in milliseconds.
  • ≈ means "is roughly equal to".
  • base_time is the fixed overhead of any request at all, before any aliases are counted: the cost of opening the connection, reading the request, and so on.
  • aliases is how many copies of the mutation you asked for.
  • cost_per_alias is how much extra time each copy adds.

In everyday terms, it is like a taxi fare: a fixed starting charge plus a price per kilometre. If you know both numbers, you can predict the fare for any distance without ever taking the trip.

Fitting the four measured points gives a base time of roughly 150 to 200 milliseconds and a cost per alias of roughly 220 to 230 milliseconds, and the fit is close to perfectly linear across every point measured. "Linear" means the graph is a straight line: double the aliases, double the extra time. "Fitting" means working out which numbers make the formula match the measurements you already have.

Linearity was the point. A linear, unbounded cost function has no ceiling: there is no built-in limit that says "this is as slow as it gets". So if the model held, there had to exist some alias count, call it n, large enough that the response time would exceed whatever timeout sat upstream of the service. A timeout is a rule that says "if this takes longer than X, give up and return an error". Predicting n mathematically means going straight at the failure instead of stumbling onto it by luck, and it turns a vague worry into a testable claim.

Step 4: testing the prediction

Using the model, the next test used 100 aliases, expecting it to land well past the breaking point. The result matched the model:

  • Response time: about 15,838 milliseconds, nearly 16 seconds
  • Result: HTTP/2 503 Service Unavailable
  • Upstream response: first byte timeout

What those mean:

  • HTTP/2 is the version of the language browsers and servers use to talk to each other. You do not need to know the details; it is just the protocol in use.
  • 503 Service Unavailable is a standard error code meaning "the server cannot handle this right now". It is the same kind of message you might see when a website is overloaded.
  • first byte timeout is the reason recorded upstream: the part of the system in front of the service waited for the first byte of a reply, waited too long, and gave up.

Up to this point everything had been "slower than before". This was the server refusing to answer at all, which is the line between elevated latency and an actual denial of service. Latency is just slowness; a denial of service is the service being genuinely unavailable.

Step 5: confirming real execution

The obvious follow-up was whether the server was really running the mutation 100 times, or merely spending time reading a large request without doing anything meaningful per alias. If it were the latter, the finding would be much weaker: a parsing cost issue rather than a business-logic execution issue. Parsing means reading and understanding the request; execution means actually carrying out the instruction. A server that is slow only at reading is far less interesting than one that is slow because it is genuinely doing the work over and over.

To settle it, a single request with 50 aliases of the mutation was sent, all pointing at an email address the researcher controlled, and the inbox was watched. Fifty separate password-reset emails arrived, one per alias. Each alias was not merely counted or parsed; it was fully executed as its own independent operation with its own side effect. A side effect is a real-world consequence, here an email actually landing in a mailbox.

That is the difference between a machine that reads a shopping list of 50 items and one that actually goes out and buys all 50. The inbox proved the buying happened.

Why it worked

The GraphQL server resolved every alias as a fully independent server-side operation. There was no batching, no deduplication and no cost limiting. Batching would mean grouping identical work together; deduplication would mean noticing the same request repeated and doing it once; cost limiting would mean refusing requests that are too expensive. None of that was in place.

Because the cost of each alias is paid in full and the total grows linearly with alias count, a single HTTP request can be made arbitrarily expensive until it exceeds the upstream first-byte timeout and the endpoint returns 503 Service Unavailable.

Existing defences did not stop it because they were aimed at the wrong unit. Defences that count HTTP requests see one request, however much work is hidden inside it. And the endpoint required no login, so the usual friction of per-account rate limits was absent: a rate limit is a cap on how often one account can do something, and with no account there is nothing to cap.

Impact

  • Single-request amplification. One HTTP request produces the full effect. This is not a volumetric, many-requests attack, which is exactly what makes it easy to miss with defences that count requests. Volumetric means flooding a server with huge numbers of requests; this is the opposite, a small number of very heavy ones.
  • Resource exhaustion. Each alias independently consumes backend CPU cycles and thread allocation on the password-reset resolver. In plain terms, the server's processor and its pool of workers get tied up doing the same job repeatedly.
  • Availability impact. Sustained exploitation could deny password-reset functionality to legitimate users, and potentially degrade other operations sharing the same backend resources. In other words, real customers could find the reset button broken, and other parts of the site could slow down too.

The 503 was reached as an unauthenticated user once the alias count pushed the response past the upstream timeout. Unauthenticated means no login was needed: anyone with a browser and the right request could do it.

Fix

The report gives remediation guidance rather than describing a change that was made:

  1. Cap the number of aliases allowed per operation. Most GraphQL servers and gateways support this natively. A cap is a hard limit, like a lift that will not take more than a certain weight.
  2. Enforce query cost analysis, not just query depth limits: assign a computational cost to each field and mutation and reject requests that exceed a budget. Depth limits only stop requests nested very deeply; they do not notice many copies side by side.
  3. Rate-limit at the operation level, not just the HTTP-request level, since a single HTTP request can contain many logical operations. Count the actual jobs, not the envelopes they arrive in.
  4. Apply the same scrutiny to unauthenticated mutations as to authenticated ones. This endpoint required no login, which removed the usual friction of per-account rate limits.

If you want to look for the same pattern elsewhere, these are the directions the report suggests:

  1. Alias the same mutation on other unauthenticated flows. Password reset, email verification, signup and contact forms are good candidates. A positive result is response time that grows linearly with alias count, followed by a timeout or 503 at a predictable count.
  2. Confirm real execution with a side effect you control. Point every alias at an address or account you own and count what arrives. A positive result is one side effect per alias, which rules out a pure parsing cost.
  3. Fit the cost model before pushing hard. Measure at a few small alias counts, fit base_time + aliases × cost_per_alias, and predict the count that should exceed the upstream timeout. A positive result is the predicted count producing the failure.
  4. Try aliasing expensive queries as well as mutations. Any resolver that does real work per invocation is a candidate. A positive result is the same linear growth in response time.
  5. Check whether depth limits alone are enforced. Send a shallow document with many aliases. A positive result is acceptance of a document that a depth limit would never catch.
  6. Test authenticated endpoints for per-account limits. If a limit exists, check whether it counts HTTP requests or logical operations. A positive result is many operations slipping through under one request.

Glossary

  • Alias: a nickname given to one copy of a field or mutation inside a GraphQL request, so several copies can coexist in one request.
  • API: the part of a website or service that a page or program talks to in order to get something done.
  • Availability: whether a service is actually usable when people need it.
  • Base time: the fixed overhead of a request, before any repeated work is counted.
  • Bug bounty programme: a scheme where a company invites outside testers to find security problems and pays for reports.
  • Burp Suite: a tool that sits between a browser and a website so you can see and edit the traffic between them.
  • Cost function: a formula describing how much time or resource a given amount of work consumes.
  • Cost per alias: how much extra time each additional alias adds.
  • CPU cycles: units of work done by a computer's processor.
  • Denial of service: making a service unavailable to the people who need it.
  • Deduplication: noticing that the same work is requested more than once and doing it only once.
  • Depth limit: a rule capping how deeply nested a request may be.
  • Endpoint: a specific address on a server that handles a particular kind of request.
  • Execution: actually carrying out an instruction, as opposed to merely reading it.
  • First byte timeout: giving up because the first part of a reply did not arrive within the allowed time.
  • GraphQL: a way of asking an API for things using a single structured request.
  • HTTP request: a message a browser or tool sends to a server asking it to do something.
  • HTTP/2: a version of the protocol browsers and servers use to communicate.
  • Latency: delay, the time something takes to respond.
  • Linear: growing in a straight line, so doubling the input doubles the output.
  • Mutation: a GraphQL operation that changes something on the server, such as sending an email.
  • P2: a severity rating on the Bugcrowd platform, the second-highest level.
  • Parsing: reading and understanding a request, without necessarily acting on it.
  • POST: an HTTP method meaning "here is some data, please act on it".
  • Query: a GraphQL operation that asks for information rather than changing anything.
  • Rate limit: a cap on how often something may be done in a period of time.
  • Resolver: the part of a GraphQL server that carries out a particular field or mutation.
  • Resource exhaustion: using up a server's processor time, workers or memory so nothing else can run.
  • Side effect: a real-world consequence of an action, such as an email arriving.
  • 503 Service Unavailable: a standard HTTP error meaning the server cannot handle the request right now.
  • Thread allocation: assigning one of a server's workers to a job.
  • Timeout: a rule that says if something takes longer than a set time, give up and return an error.
  • Unauthenticated: done without logging in.
  • Upstream: the part of the system sitting in front of, or behind, the service being tested.
  • Volumetric attack: an attack that relies on sending a very large number of requests.

More by Ahmed Mahmoud

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.