Skip to content
DoS Disclosed report Beginner

Circular based introspetion Query leading to single request denial of service and cost consumption and query cost on api.sorare.com/graphql

The GraphQL API lacked query depth limits, allowing an attacker to send a deeply nested introspection query that caused a single-request denial of service and significant server delay. The attack required no authentication and could affect both the public and playground GraphQL instances.

thebeast99 Follow

Originally disclosed on HackerOne

Medium 6.1 View original
  • Triaged in 8 days
  • Fixed in 14 months
  • Paid in 8 days
  • Disclosed after 15 months

Summary:

Hi Team, Hope you are doing great Sorare graphql Api has introspection enabled by default as per the policy it's meant to be public so they can facilitate their users with Graphql Playground.

So https://api.sorare.com/federal/graphql is for the users and clients using the web application and https://api.sorare.com/graphql is a playground for the developers and clients. They both share the same domain and database just a different graphql instance We can execute the same query on both graphql servers parallelly. But the catch here is because of the no-depth limits an attacker can execute a circular introspection query which is leading to a single request denial of service which is affecting both instances same time. Users don't need to be authenticated for this attack which is an extreme condition.

APIs are always the backbone of the organization and a firm. If left vulnerable that kinda attack requires a single request to take down the server and can Impact the Availability of the company. And bypassing the Cloudflare DDOS which is playing a role as a frontier to prevent such cases. You have to consider this that it is not a typical DOS attack that requires so many bots or computational power a single query can Do pretty much damage.

Steps To Reproduce:

Its been years now and we all know what an introspection query looks like but with the graphql feature, we can also retrieve just one query time at a time from __schema we can just retrieve all fields of mutations, queries and subscription. By calling fields and their types.

Here is the request:

POST /graphql HTTP/2
Host: api.sorare.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Referer: https://api.sorare.com/graphql/playground
Content-Type: application/json
Origin: https://api.sorare.com
Content-Length: 262
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

From the above query, you will get the 3728114 bytes of data in the single query which is obviously duplicated can be seen in the query request and the delay will be around 5 to 7 seconds which is extreme degradation condition for a backend server.

Response In my case:

sorare_dos.PNG
sorare_dos.PNG From the original on HackerOne

You can Add more recursive loops the more loop the more delay Here is the query with one more circular recursive loop

{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     type {\r\n     fields {\r\n      name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

Now you can see more delay.

I hope you can see the impact of this vulnerability. If there is anything the team wants to know I would be grateful!

Best & kind regards @thebeast99

Supporting Material/References:

Here is the official Apollo guide regarding the depth limits. https://www.apollographql.com/docs/technotes/TN0021-graph-security/#limit-query-depth

Note: I set the cvss as per the bug But because the scope is High asset my report automatically scored as 9.3 critical whereas in other cases it's always standard 7.5 High.

Impact

An attacker can take down the server with few or a single graphql request. Which will cost Availability to sorare.com

The original report as published on HackerOne, by thebeast99. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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. 5 min read.

Context

Sorare exposes a GraphQL API at api.sorare.com. The report describes two GraphQL instances on that domain that share the same domain and database but run as separate GraphQL instances:

  • https://api.sorare.com/federal/graphql, used by users and clients of the web application.
  • https://api.sorare.com/graphql, a playground for developers and clients.

Introspection is enabled by default on the API. The researcher notes that this is intentional: it is meant to be public so that users can be served by the GraphQL Playground. The same query can be executed against both GraphQL servers in parallel.

Setup

No account, role or special tooling is needed. The researcher states explicitly that users do not need to be authenticated for this attack, which he calls an extreme condition. The only precondition is that introspection is reachable, which it is by design.

Finding it

The researcher's observation is that the API has no depth limits. GraphQL introspection exposes __schema, and from it the fields of mutations, queries and subscriptions can be retrieved by calling fields and their types. Because the same field structure can be nested inside itself repeatedly, a query can be built that walks the type graph in a circular fashion. Each additional nesting level multiplies the work and the response size, and the whole thing is reachable in a single unauthenticated request.

Exploitation

Step 1: Send a circular introspection query

The researcher sends the following request to the playground endpoint. It is a POST to /graphql on api.sorare.com, with a JSON body whose query nests __schema { types { fields { type { fields { type { ... } } } } } } several levels deep before finally asking for name.

HTTP
POST /graphql HTTP/2
Host: api.sorare.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Referer: https://api.sorare.com/graphql/playground
Content-Type: application/json
Origin: https://api.sorare.com
Content-Length: 262
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

The important part is the repeated fields { type { ... } } block. Each repetition re-enters the type graph from the field's type, so the resolver has to expand the same structure again at every level. The name leaf at the bottom is the field finally returned at the deepest level.

According to the researcher, this single query returns 3728114 bytes of data, with a delay of around 5 to 7 seconds. He describes the result as obviously duplicated, which can be seen in the query request itself, and calls the delay an extreme degradation condition for a backend server.

sorare_dos.PNG
sorare_dos.PNG From the original on HackerOne

The screenshot shows the response the researcher received for this request.

Step 2: Add another recursive loop

The researcher notes that more recursive loops produce more delay, and provides a second query with one more circular recursive loop:

JSON
{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     type {\r\n     fields {\r\n      name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

This is the same structure with one additional type { fields { ... } } level before the name leaf. The researcher reports that the delay is greater, without giving a specific figure for this variant.

Step 3: Hit both instances

Because https://api.sorare.com/federal/graphql and https://api.sorare.com/graphql share the same domain and database, the same query can be executed on both GraphQL servers in parallel. The researcher states that the single-request denial of service affects both instances at the same time.

Root cause

The design mistake is the absence of a query depth limit on the GraphQL schema. Introspection is intentionally public, and __schema exposes a type graph in which a field's type can itself have fields, so the same selection set can be nested into itself indefinitely. Without a depth limit, the server accepts and resolves the full nested tree, and the response grows with every level. The researcher links the official Apollo guidance on depth limits as the reference for the missing control:

Text
https://www.apollographql.com/docs/technotes/TN0021-graph-security/#limit-query-depth

He also points out that the attack bypasses Cloudflare DDOS, which he describes as playing the role of a frontier to prevent such cases. The researcher notes the attack bypasses Cloudflare DDOS because it is not a typical DoS requiring many bots or computational power: a single query can do considerable damage.

Impact

The researcher's impact statement is that an attacker can take down the server with few or a single GraphQL request, costing availability to sorare.com. He stresses that this is not a typical DoS attack requiring many bots or computational power: a single query can do considerable damage, and it affects both the user-facing and the playground instances at once. No authentication is required.

The report was rated medium with a CVSS of 6.1.

Fix

The report does not describe a fix that was applied. The direction it points to is the Apollo guidance it cites: enforce a query depth limit so that circular introspection queries are rejected before they are resolved.

Variants to test

  • On other GraphQL endpoints with introspection enabled, send a nested __schema { types { fields { type { fields { ... name } } } } } query and increase the nesting one level at a time. A positive result is a response that grows sharply with each added level and a response time that climbs accordingly, with no depth-limit error returned.
  • Try the same query against every GraphQL path on the same host (for example a user-facing path and a playground path). A positive result is that both paths accept the deep query, since they may share a backend.
  • Compare the response size and latency of the deep query against a shallow introspection query. A positive result is a large, disproportionate increase in bytes and delay for a single request.
  • Check whether a WAF or DDoS layer in front of the endpoint blocks the request. A positive result for the attacker is that a single well-formed request passes through untouched, as the researcher reports for Cloudflare here.

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

Sorare runs a website where people collect and trade digital football cards. Behind that website sits an API: a service that the website and mobile apps talk to in order to fetch data and perform actions. Think of the API as the kitchen of a restaurant: you (the app) do not walk into the kitchen yourself, you give your order to the waiter, and the kitchen prepares it and sends it back. The API is the kitchen, and the website is the dining room.

Sorare's API speaks a language called GraphQL. In a normal API, the kitchen has a fixed menu: you can ask for dish number 3 and you get exactly what dish number 3 is. With GraphQL, you write your own order in a small query language: you describe precisely which pieces of data you want and how they relate to each other, and the server assembles exactly that. This is powerful, but it also means the customer writes the recipe, and the kitchen has to follow it.

The researcher, thebeast99, found that Sorare's GraphQL API had no limit on how deeply nested a query could be. He could write a query that asks the server to look inside a structure, then inside that structure, then inside that again, over and over, and the server would obediently do all of it. Because the structure refers to itself, the same request could be made to expand enormously. In the researcher's case, one single request, sent with no account, returned 3728114 bytes of data with a delay of around 5 to 7 seconds. Repeating the nesting made it worse. The researcher states the single-request denial of service affects both instances at the same time. This kind of attack is called a denial of service (DoS): you are not stealing data, you are making the service unavailable to its real users.

The two endpoints

Sorare exposes a GraphQL API at api.sorare.com. The report describes two GraphQL instances on that domain. They share the same domain and the same database, but they run as separate GraphQL instances:

  • https://api.sorare.com/federal/graphql, used by users and clients of the web application.
  • https://api.sorare.com/graphql, a playground for developers and clients.

A playground is a web page where developers can type GraphQL queries by hand and see the results, a bit like a test kitchen where chefs try out new dishes before they go on the menu. The important detail is that both addresses lead to the same underlying data and can be queried at the same time. If you can make one of them struggle, you can make both struggle.

Introspection is enabled by default on the API. Introspection is a GraphQL feature that lets a client ask the server to describe itself: what queries exist, what fields each type has, what arguments they take. It is like asking the restaurant to hand you its full menu with every ingredient listed. The researcher notes that this is intentional: it is meant to be public so that users can be served by the GraphQL Playground. In other words, the self-description is not the bug. The bug is what happens when that self-description can be asked for in a circular, deeply nested way.

What you need to try it

No account, no role and no special tooling are needed. The researcher states explicitly that users do not need to be authenticated for this attack, which he calls an extreme condition. Authenticated means logged in, proving who you are, usually with a username and password or a session cookie. Here, anyone at all can send the request. The only precondition is that introspection is reachable, which it is by design.

How the researcher found it

The researcher's observation is that the API has no depth limits. A depth limit is a rule that says "a query may not nest more than N levels deep". Without it, the server will follow any nesting you write, however deep.

GraphQL introspection exposes a special field called __schema. From __schema you can retrieve the fields of mutations, queries and subscriptions by calling fields and their types. In plain terms: the schema is a map of the API, and every entry on the map points to other entries. A field has a type, and that type has fields, and those fields have types, and so on. Because the same field structure can be nested inside itself repeatedly, a query can be built that walks this map in a circle. Each additional nesting level multiplies the work and the response size, and the whole thing is reachable in a single unauthenticated request.

A useful comparison: imagine a form that asks "who is your manager?", and the answer is a person, and every person has a manager. If you ask "who is your manager's manager's manager's manager...", a sensible clerk stops you after a few levels. A clerk with no rule about depth will keep walking up the chain until you tell it to stop, and if the chain loops, it can walk forever. Here the "chain" is the type graph, and the server walks it as many times as the query asks.

Exploitation

Step 1: Send a circular introspection query

The researcher sends the following request to the playground endpoint. It is a POST to /graphql on api.sorare.com, with a JSON body whose query nests __schema { types { fields { type { fields { type { ... } } } } } } several levels deep before finally asking for name.

HTTP
POST /graphql HTTP/2
Host: api.sorare.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: application/json
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Referer: https://api.sorare.com/graphql/playground
Content-Type: application/json
Origin: https://api.sorare.com
Content-Length: 262
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

Line by line, in plain words:

  • POST /graphql HTTP/2 is the first line of an HTTP request. POST means "I am sending data to the server", /graphql is the address on the server, and HTTP/2 is the version of the web protocol being used. Think of it as the envelope of a letter: it says where the letter goes and how it is being delivered.
  • Host: api.sorare.com names the website the request is for. One server can host many websites, so the server needs to know which one you mean.
  • User-Agent: Mozilla/5.0 ... tells the server which browser and operating system the sender claims to be. Here it is a Firefox identifier. This is normal for any browser request.
  • Accept: application/json says "I would like the answer in JSON format". JSON is a simple text format for structured data, using curly braces and colons, like a very tidy shopping list.
  • Accept-Language: en-US says the sender prefers English (United States).
  • Accept-Encoding: gzip, deflate says the sender can accept compressed answers, to save bandwidth.
  • Referer: https://api.sorare.com/graphql/playground says which page the request came from. Here it is the GraphQL playground page, which is what a developer using the playground would normally send.
  • Content-Type: application/json says the body of the request is JSON.
  • Origin: https://api.sorare.com says which site the request originates from. Browsers send this automatically for cross-origin requests, and servers use it for security checks.
  • Content-Length: 262 says the body is 262 bytes long.
  • Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site and Te are extra browser headers that describe the context of the request. They are the kind of thing a real browser adds without the user thinking about it.
  • The blank line separates the headers from the body. Everything after it is the actual message.
  • The body is a JSON object with three keys. operationName is null, meaning there is only one operation in the query so no name is needed to pick it. variables is an empty object, meaning the query uses no variables. query holds the GraphQL query itself, written as a string with \r\n escape sequences for line breaks.
  • Inside the query string, query { starts the operation. __schema { asks for the schema description. types { asks for the list of types. fields { asks for the fields of each type. type { asks for the type of each field. Then the same fields { type { ... } } block repeats several times, each time re-entering the type graph from the field's type. Finally name asks for the name at the bottom of the tree.

The important part is the repeated fields { type { ... } } block. Each repetition re-enters the type graph from the field's type, so the resolver has to expand the same structure again at every level. A resolver is the piece of server code that actually fetches or computes the value for one field. The name leaf at the bottom is the field finally returned at the deepest level.

According to the researcher, this single query returns 3728114 bytes of data, with a delay of around 5 to 7 seconds. He describes the result as obviously duplicated, which can be seen in the query request itself, and calls the delay an extreme degradation condition for a backend server. In everyday terms: one letter, one stamp, and the kitchen is busy for several seconds and hands back a box of several megabytes.

sorare_dos.PNG
sorare_dos.PNG From the original on HackerOne

The screenshot shows the response the researcher received for this request.

Step 2: Add another recursive loop

The researcher notes that more recursive loops produce more delay, and provides a second query with one more circular recursive loop:

JSON
{"operationName":null,"variables":{},"query":"query {\r\n __schema {\r\n   types { \r\n    fields {\r\n      type {\r\n    fields {\r\n      type { \r\n    fields {\r\n      type {\r\n     fields {\r\n     type {\r\n     fields {\r\n      name\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}"}

This is the same structure with one additional type { fields { ... } } level before the name leaf. Reading it the same way as before: the outer JSON wrapper is unchanged, the query string starts with query {, and then the __schema { types { fields { type { ... } } } } pattern repeats one more time than in the first request. The researcher reports that the delay is greater, without giving a specific figure for this variant. The lesson is the same as with the manager chain: every extra level you ask for multiplies the work, and the server has no rule that says "stop here".

Step 3: Hit both instances

Because https://api.sorare.com/federal/graphql and https://api.sorare.com/graphql share the same domain and database, the same query can be executed on both GraphQL servers in parallel. The researcher states that the single-request denial of service affects both instances at the same time. In restaurant terms: the same order sent to both the main kitchen and the test kitchen, and both kitchens are the same kitchen underneath.

Root cause

The design mistake is the absence of a query depth limit on the GraphQL schema. Introspection is intentionally public, and __schema exposes a type graph in which a field's type can itself have fields, so the same selection set can be nested into itself indefinitely. Without a depth limit, the server accepts and resolves the full nested tree, and the response grows with every level. The researcher links the official Apollo guidance on depth limits as the reference for the missing control:

Text
https://www.apollographql.com/docs/technotes/TN0021-graph-security/#limit-query-depth

Apollo is a company that makes widely used GraphQL tooling, and the linked page is its technical note on GraphQL security, specifically the section on limiting query depth.

He also points out that the attack bypasses Cloudflare DDOS, which he describes as playing the role of a frontier to prevent such cases. Cloudflare is a company that sits in front of many websites and filters traffic before it reaches the origin server, a bit like a bouncer at the door. A DDoS (distributed denial of service) is the classic attack where thousands of machines flood a site with traffic until it collapses; the bouncer is good at spotting a crowd. The researcher notes the attack bypasses Cloudflare DDOS because it is not a typical DoS requiring many bots or computational power: a single query can do considerable damage.

Impact

The researcher's impact statement is that an attacker can take down the server with few or a single GraphQL request, costing availability to sorare.com. He stresses that this is not a typical DoS attack requiring many bots or computational power: a single query can do considerable damage, and it affects both the user-facing and the playground instances at once. No authentication is required.

The report was rated medium with a CVSS of 6.1. CVSS is a standard scoring system for the severity of a security flaw, where a higher number means more serious. The researcher notes that he set the CVSS according to the bug, but because the scope is a high-value asset his report was automatically scored as 9.3 critical, whereas in other cases it is always a standard 7.5 high. The researcher notes that because the scope is a high-value asset his report was automatically scored as 9.3 critical, whereas in other cases it is always a standard 7.5 high.

Fix

The report does not describe a fix that was applied. The direction it points to is the Apollo guidance it cites: enforce a query depth limit so that circular introspection queries are rejected before they are resolved.

Variants to test

These are the kinds of checks the researcher's findings suggest trying elsewhere. They are written for someone testing their own systems or systems they are authorised to test.

  • On other GraphQL endpoints with introspection enabled, send a nested __schema { types { fields { type { fields { ... name } } } } } query and increase the nesting one level at a time. A positive result is a response that grows sharply with each added level and a response time that climbs accordingly, with no depth-limit error returned.
  • Try the same query against every GraphQL path on the same host (for example a user-facing path and a playground path). A positive result is that both paths accept the deep query, since they may share a backend.
  • Compare the response size and latency of the deep query against a shallow introspection query. A positive result is a large, disproportionate increase in bytes and delay for a single request.
  • Check whether a WAF or DDoS layer in front of the endpoint blocks the request. A WAF (web application firewall) is a filter that inspects requests for malicious patterns. A positive result for the attacker is that a single well-formed request passes through untouched, as the researcher reports for Cloudflare here.

Glossary

  • API: a service that software talks to in order to fetch data or perform actions, like a kitchen that prepares orders for the dining room.
  • GraphQL: a query language for APIs where the client describes exactly which data it wants and how it relates, instead of picking from fixed endpoints.
  • Endpoint: a specific address on a server that accepts requests, such as /graphql.
  • Instance: one running copy of a service. Two instances can share a domain and database while running separately.
  • Playground: a web page where developers can type GraphQL queries by hand and see the results.
  • Introspection: a GraphQL feature that lets a client ask the server to describe its own schema, including types and fields.
  • Schema: the map of what a GraphQL API offers: which queries, mutations and types exist and how they connect.
  • __schema: the special introspection field that returns the schema description.
  • Mutation: a GraphQL operation that changes data, as opposed to a query that only reads it.
  • Subscription: a GraphQL operation that keeps a connection open to receive updates over time.
  • Resolver: the server-side code that computes the value for one field in a query.
  • Depth limit: a rule that rejects queries nested more than a set number of levels.
  • Denial of service (DoS): an attack that makes a service unavailable to its real users, rather than stealing data.
  • DDoS: a denial of service carried out by many machines at once, flooding a target with traffic.
  • Authentication: proving who you are, usually by logging in. An unauthenticated request is one sent without logging in.
  • Session cookie: a small piece of data a browser stores to stay logged in to a site.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Header: a line in an HTTP request or response carrying metadata, such as the host or content type.
  • JSON: a text format for structured data using curly braces, colons and commas.
  • Byte: a unit of digital information; roughly one character of text. A megabyte is about a million bytes.
  • Latency: the time between sending a request and getting a response.
  • Serialise: to turn computed data into the bytes that are sent over the network.
  • Cloudflare: a company that sits in front of websites and filters traffic before it reaches the origin server.
  • WAF: web application firewall, a filter that inspects requests for malicious patterns.
  • CVSS: a standard scoring system for the severity of a security flaw, where a higher number means more serious.
  • Apollo: a company that makes widely used GraphQL tooling and publishes security guidance, including on depth limits.

More from Sorare

View all

The newest disclosed reports for this program.

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.