CVE-2025-31496 is a high-severity (CVSS 7.5) CWE-770 vulnerability in apollo-compiler. A fix is available for apollo-compiler — see the affected versions and patch details below.
apollo-compiler Named Fragment Processing Vulnerability
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- 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-2025-31496.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
apollo-compilerReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Impact
Summary
A vulnerability in Apollo Compiler allowed queries with deeply nested and reused named fragments to be prohibitively expensive to validate. This could lead to excessive resource consumption and denial of service in applications.
Details
Named fragments were being processed once per fragment spread in some cases during query validation, leading to exponential resource usage when deeply nested and reused fragments were involved.
Fix/Mitigation
The validation logic has been updated to process each named fragment only once, preventing redundant traversal.
Patches
This has been remediated in apollo-compiler version 1.27.0.
Workarounds
No known direct workarounds exist.
Acknowledgements
We appreciate the efforts of the security community in identifying and improving the performance and security of query validation mechanisms.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | apollo-compiler | all versions | 1.27.0cargo update -p apollo-compiler --precise 1.27.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for apollo-compiler, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update apollo-compiler to 1.27.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-31496 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2025-31496 in your dependencies?
Find it across crates.io, including transitive dependencies.