CVE-2022-21708 is a medium-severity (CVSS 6.5) Uncontrolled Resource Consumption vulnerability in github.com/graph-gophers/graphql-go. A fix is available for github.com/graph-gophers/graphql-go — see the affected versions and patch details below.
Denial of Service in graphql-go
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-21708.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2022-21708 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/graph-gophers/graphql-goReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Impact
This is 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. To make things worse the only mitigation in affected versions creates opportunities for other attacks. This issue is only available if you are using graphql.MaxDepth option in your schema (which is highly recommended in most cases).
Patches
The issue has been patched in version v1.3.0. We have been trying to maintain backwards compatibility and avoid breaking changes so upgrading should not be problematic.
Workarounds
The best workaround is to patch to a version greater than or equal to v1.3.0.
Otherwise, the only workaround in versions prior to v1.3.0 is to disable the graphql.MaxDepth option from your schema. Unfortunately, this could potentially create opportunities for other attacks.
References
There are no references or links. This issue was reported privately and was fixed before creating this Security Advisory.
For more information
If you have any questions or comments feel free to reach out to @pavelnikolov or @tony on the Gopher Slack.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/graph-gophers/graphql-go | all versions | 1.3.0go get github.com/graph-gophers/graphql-go@v1.3.0 |
Affected Products
graphql-gographql-go_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/graph-gophers/graphql-go, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/graph-gophers/graphql-go to 1.3.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-21708 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.12 | openshift4/ose-console:v4.12.0-202406190905.p0.g8654e63.assembly.stream.el8 | RHSA-2024:4006 |
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-console:v4.13.0-202406112237.p0.gdc7be0c.assembly.stream.el8 | RHSA-2024:3885 |
| Red Hat OpenShift Container Platform 4.14 | openshift4/ose-console:v4.14.0-202402061340.p0.g3cab6c4.assembly.stream.el8 | RHSA-2024:0735 |
Frequently Asked Questions
Is CVE-2022-21708 in your dependencies?
Find it across Go, including transitive dependencies.