CVE-2025-31496 apollo-compiler Named Fragment Processing Vulnerability

High 7.5 Published Updated

Attackers can cause denial of service in applications using apollo-compiler by submitting queries with deeply nested and reused named fragments.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-31496?

CVE-2025-31496 is a high-severity denial of service vulnerability in apollographql apollo-rs, published on 7 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-770

Which versions are affected by CVE-2025-31496?

2 open source packages ship an affected version, including apollo-compiler.

PackageAffectedFixed in
apollo-compiler crates.ioAll versions1.27.0
apollo-compiler crates.ioAll versions1.27.0

How do I fix CVE-2025-31496?

Upgrade apollo-compiler to 1.27.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-2025-31496 being exploited?

There is no known exploitation of CVE-2025-31496 in the wild and no public exploit code.

Sources

Also known as GHSA-7mpv-9xg6-5r79.

Is CVE-2025-31496 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free