CVE-2025-31485: api-platform/graphql and api-platform/core - GraphQL Grant Caching Vulnerability

api-platform/graphql Updated 02 Oct 2025

Summary

04/04/2025
Yes i
High
7.5

CVE-2025-31485: GraphQL grant on a property might be cached with different objects. Affects api-platform/graphql across 3 version ranges.

< 3.4.17 >= 4.0.0-alpha.1, < 4.0.22 >= 4.1.0-alpha.1, < 4.1.5

Fixed in 3.4.17, 4.0.22 or 4.1.5, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The api-platform/graphql and api-platform/core packages are integral parts of the API Platform framework, which is designed to facilitate the development of web APIs. These packages provide tools for building GraphQL APIs, enabling developers to define data structures and queries efficiently. However, a vulnerability exists in the way security grants are cached for properties in the GraphQL ItemNormalizer, potentially leading to unauthorized access to sensitive data.

Vulnerability Detail

The vulnerability arises from the caching mechanism in the GraphQL ItemNormalizer, where security grants on properties are evaluated only once and cached. This means that if a different object is passed, the cached grant may still apply, allowing access to properties that should be restricted. This flaw can lead to unauthorized data exposure, posing a significant security risk to applications using these packages.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.4.17 3.4.17
    composer require api-platform/graphql:3.4.17
  • >= 4.0.0-alpha.1, < 4.0.22 4.0.22
    composer require api-platform/graphql:4.0.22
  • >= 4.1.0-alpha.1, < 4.1.5 4.1.5
    composer require api-platform/graphql:4.1.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, you can override the ItemNormalizer to customize the caching behavior. This involves creating a new normalizer class that implements your desired security checks without relying on the default caching mechanism.

Conclusion

In summary, CVE-2025-31485 presents a significant security risk for applications using the api-platform/graphql and api-platform/core packages due to improper caching of security grants. It is crucial to update to the patched version or implement a workaround to mitigate this vulnerability.

See every vulnerability recorded for api-platform/graphql →

Share this vulnerability

FAQ

CVE-2025-31485 is a vulnerability affecting the api-platform/graphql and api-platform/core packages, where security grants on properties may be cached incorrectly, leading to unauthorized access.

If your application uses these packages, it may inadvertently expose sensitive properties to users who should not have access, potentially compromising data security.

If updating is not immediately possible, consider implementing the suggested workaround by overriding the ItemNormalizer to prevent caching issues.

You can use Vulert, which monitors open-source vulnerabilities in your software. Visit the Vulert playground at Vulert Scanner to check your application without needing to sign up.

The CVSS score for this vulnerability is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for api-platform/graphql.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 3.4.17 3.4.17
    composer require api-platform/graphql:3.4.17
  • >= 4.0.0-alpha.1, < 4.0.22 4.0.22
    composer require api-platform/graphql:4.0.22
  • >= 4.1.0-alpha.1, < 4.1.5 4.1.5
    composer require api-platform/graphql:4.1.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback