API Platform Core GraphQL Cache Key Vulnerability Allowing Improper Access Grants

Vulnerability

A vulnerability exists in API Platform Core's GraphQL implementation, specifically in versions prior to 4.0.22 and 3.4.16. The issue arises because security grants on properties can be cached with different objects, leading to incorrect access permissions. The problem is rooted in the ItemNormalizer's caching mechanism, which fails to properly account for variations in object instances. As a result, properties may be exposed or restricted incorrectly, depending on the cached context.

Impact

This vulnerability can lead to unauthorized access to GraphQL properties, allowing users to read data they should not have permission to access.

Reproduction

To reproduce this vulnerability, apply a security grant to a property using the ApiProperty annotation in a GraphQL query. The grant will be cached and evaluated only once, regardless of whether the object has changed. This can be tested by creating multiple instances of an object with different property values and observing that the cached grant does not reflect these changes.

Remediation

Users can update to API Platform Core versions 4.0.22 or 3.4.17, both of which include the necessary fix. Instructions for updating can be found in the API Platform documentation.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
1.0
impact
2.5
exploitability
9.3
remediation
7.7
relevance
0.0
threat
4.8
urgency
2.9
incentive
10.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.