CVE-2025-31496
JSON

7.5high

apollo-compiler Named Fragment Processing Vulnerability

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.44% (higher than 39% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7mpv-9xg6-5r79

Description

apollo-compiler is a query-based compiler for the GraphQL query language. Prior to 1.27.0, a vulnerability in Apollo Compiler allowed queries with deeply nested and reused named fragments to be prohibitively expensive to validate. 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. This could lead to excessive resource consumption and denial of service in applications. This vulnerability is fixed in 1.27.0.

Affected

Product or packageVersionsReported by
apollographql apollo-rs< 1.27.0CVE List
apollo-compiler (crates.io)before 1.27.0GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-770

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

apollo-compiler is a query-based compiler for the GraphQL query language. Prior to 1.27.0, a vulnerability in Apollo Compiler allowed queries with deeply nested and reused named fragments to be prohibitively expensive to validate. 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. This could lead to excessive resource consumption and denial of service in applications. This vulnerability is fixed in 1.27.0.

GitHub Advisory Database

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.

NVD (es)

apollo-compiler es un compilador basado en consultas para el lenguaje de consulta GraphQL. Antes de la versión 1.27.0, una vulnerabilidad en Apollo Compiler hacía que la validación de consultas con fragmentos con nombre profundamente anidados y reutilizados fuera extremadamente costosa. En algunos casos, los fragmentos con nombre se procesaban una vez por fragmento distribuido durante la validación de consultas, lo que provocaba un consumo exponencial de recursos al usar fragmentos profundamente anidados y reutilizados. Esto podía provocar un consumo excesivo de recursos y denegación de servicio en las aplicaciones. Esta vulnerabilidad se corrigió en la versión 1.27.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-31496 changed 2025-04-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-7mpv-9xg6-5r79 changed 2025-04-08CC-BY-4.0
NVDCVE-2025-31496 changed 2026-06-17Public domain