CVE-2022-21708 Denial of Service in graphql-go
An attacker can cause a stack overflow panic in the graphql-go library by sending specifically designed queries, leading to a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-21708?
CVE-2022-21708 is a medium-severity denial of service vulnerability in graph-gophers graphql-go, published on 21 Jan 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
graphql-go is a GraphQL server with a focus on ease of use. In versions prior to 1.3.0 there exists a DoS vulnerability that is possible due to a bug in the library that would allow an attacker with specifically designed queries to cause stack overflow panics. Any user with access to the GraphQL handler can send these queries and cause stack overflows. This in turn could potentially compromise the ability of the server to serve data to its users. The issue has been patched in version `v1.3.0`. The only known workaround for this issue is to disable the `graphql.MaxDepth` option from your schema which is not recommended.
Which versions are affected by CVE-2022-21708?
3 open source packages ship an affected version, including github.com/graph-gophers/graphql-go. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/graph-gophers/graphql-go Go | All versions | 1.3.0 |
github.com/graph-gophers/graphql-go Go | All versions | 1.3.0 |
github.com/graph-gophers/graphql-go Go | All versions | 1.3.0 |
Products include Graphql-Go Project Graphql-Go.
How do I fix CVE-2022-21708?
Upgrade github.com/graph-gophers/graphql-go to 1.3.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2022-21708 being exploited?
There is no known exploitation of CVE-2022-21708 in the wild and no public exploit code.
Other vulnerabilities in graph-gophers graphql-go
Sources
Also known as DEBIAN-CVE-2022-21708, GHSA-mh3m-8c74-74xh, GO-2022-0300, UBUNTU-CVE-2022-21708.