CVE-2025-31485
GraphQL grant on a property might be cached with different objects
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Prior to 4.0.22 and 3.4.17, a GraphQL grant on a property might be cached with different objects. The ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method is meant to prevent the caching but the parent::normalize method that is called afterwards still creates the cache key and causes the issue. This vulnerability is fixed in 4.0.22 and 3.4.17.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.5
GraphQL grant on a property might be cached with different objects
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Prior to 4.0.22 and 3.4.17, a GraphQL grant on a property might be cached with different objects. The ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method is meant to prevent the caching but the parent::normalize method that is called afterwards still creates the cache key and causes the issue. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31485- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-696
- Updated
- 2026-11-02
EUVDEUVD-2025-9735
7.5
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Prior to 4.0.22 and 3.4.17, a GraphQL grant on a property might be cached with different objects. The ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method is meant to prevent the caching but the parent::normalize method that is called afterwards still creates the cache key and causes the issue. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
EUVD-2025-9735- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-428q-q3vv-3fq3
7.5
GraphQL grant on a property might be cached with different objects
Original message:
I found an issue with security grants on on properties in the GraphQL ItemNormalizer:
If you use something like #[ApiProperty(security: 'is_granted("PROPERTY_READ", [object, property])')] on a member of an entity, the grant gets cached and is only evaluated once, even if the object in question is a different one.
There is the ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method that seems to be intended to prevent this: https://github.com/api-platform/core/blob/88f5ac50d20d6510686a7552310cc567fcca45bf/src/GraphQl/Serializer/ItemNormalizer.php#L160-L164
and in its usage on line 90 it does indeed not create a cache key, but the parent::normalize() that is called afterwards still creates the cache key and causes the issue.
Impact
It grants access to properties that it should not.
Workarounds
Override the ItemNormalizer.
Patched at: https://github.com/api-platform/core/commit/7af65aad13037d7649348ee3dcd88e084ef771f8
- Record
GHSA-428q-q3vv-3fq3- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-696
- Updated
- 2026-11-02
NVD
7.5
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Prior to 4.0.22 and 3.4.17, a GraphQL grant on a property might be cached with different objects. The ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method is meant to prevent the caching but the parent::normalize method that is called afterwards still creates the cache key and causes the issue. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31485- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-696
- Updated
- 2026-11-02
OSV
7.5
GraphQL grant on a property might be cached with different objects
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Prior to 4.0.22 and 3.4.17, a GraphQL grant on a property might be cached with different objects. The ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method is meant to prevent the caching but the parent::normalize method that is called afterwards still creates the cache key and causes the issue. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31485- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-696
- Updated
- 2026-11-02
OSVGHSA-428q-q3vv-3fq3
7.5
GraphQL grant on a property might be cached with different objects
Original message:
I found an issue with security grants on on properties in the GraphQL ItemNormalizer:
If you use something like #[ApiProperty(security: 'is_granted("PROPERTY_READ", [object, property])')] on a member of an entity, the grant gets cached and is only evaluated once, even if the object in question is a different one.
There is the ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe() method that seems to be intended to prevent this: https://github.com/api-platform/core/blob/88f5ac50d20d6510686a7552310cc567fcca45bf/src/GraphQl/Serializer/ItemNormalizer.php#L160-L164
and in its usage on line 90 it does indeed not create a cache key, but the parent::normalize() that is called afterwards still creates the cache key and causes the issue.
Impact
It grants access to properties that it should not.
Workarounds
Override the ItemNormalizer.
Patched at: https://github.com/api-platform/core/commit/7af65aad13037d7649348ee3dcd88e084ef771f8
- Record
GHSA-428q-q3vv-3fq3- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-696
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
api-platform/graphqlPackagist |
before 3.4.17 | 3.4.17 |
api-platform/corePackagist |
before 3.4.17 | 3.4.17 |
api-platform/graphqlPackagist |
4.0.0-alpha.1 up to 4.0.22 | 4.0.22 |
api-platform/corePackagist |
4.0.0-alpha.1 up to 4.0.22 | 4.0.22 |
api-platform/corePackagist |
4.1.0-alpha.1 up to 4.1.5 | 4.1.5 |
api-platform/graphqlPackagist |
4.1.0-alpha.1 up to 4.1.5 | 4.1.5 |
api-platform/graphqlPackagist |
4.0.0-alpha.1 up to 4.0.22, plus listed versions v4.0.0v4.0.0-alpha.1v4.0.0-alpha.2v4.0.0-alpha.3v4.0.0-alpha.4 Show 26 moreShow lessv4.0.0-alpha.5v4.0.0-alpha.6v4.0.0-alpha.7v4.0.0-beta.1v4.0.0-beta.2v4.0.1v4.0.10v4.0.11v4.0.12v4.0.13v4.0.14v4.0.15v4.0.16v4.0.17v4.0.18v4.0.19v4.0.2v4.0.20v4.0.21v4.0.3v4.0.4v4.0.5v4.0.6v4.0.7v4.0.8v4.0.9 |
4.0.22 |
api-platform/corePackagist |
4.0.0-alpha.1 up to 4.0.22, plus listed versions v4.0.0v4.0.0-alpha.1v4.0.0-alpha.2v4.0.0-alpha.3v4.0.0-alpha.4 Show 26 moreShow lessv4.0.0-alpha.5v4.0.0-alpha.6v4.0.0-alpha.7v4.0.0-beta.1v4.0.0-beta.2v4.0.1v4.0.10v4.0.11v4.0.12v4.0.13v4.0.14v4.0.15v4.0.16v4.0.17v4.0.18v4.0.19v4.0.2v4.0.20v4.0.21v4.0.3v4.0.4v4.0.5v4.0.6v4.0.7v4.0.8v4.0.9 |
4.0.22 |
api-platform/graphqlPackagist |
before 3.4.17, plus listed versions v3.2.0-beta.1v3.2.1v3.2.10v3.2.11v3.2.12 Show 45 moreShow lessv3.2.2v3.2.25v3.2.3v3.2.4v3.2.5v3.2.6v3.2.7v3.2.8v3.2.9v3.3.0-alpha.1v3.3.0-beta.1v3.3.11v3.3.13v3.3.14v3.3.15v3.3.3v3.3.4v3.3.6v3.3.7v3.3.8v3.3.9v3.4.0v3.4.0-alpha.1v3.4.0-alpha.2v3.4.0-alpha.3v3.4.0-alpha.4v3.4.0-alpha.5v3.4.0-alpha.6v3.4.0-alpha.7v3.4.0-beta.1v3.4.1v3.4.10v3.4.11v3.4.13v3.4.14v3.4.15v3.4.16v3.4.2v3.4.3v3.4.4v3.4.5v3.4.6v3.4.7v3.4.8v3.4.9 |
3.4.17 |
api-platform/corePackagist |
before 3.4.17, plus listed versions v1.0.0v1.0.0-betav1.0.0-beta.2v1.0.0-beta.3v1.0.1 Show 45 moreShow lessv1.1.0v1.1.0-beta.1v1.1.0-beta.2v1.1.1v2.0.0v2.0.0-alpha.1v2.0.0-alpha.2v2.0.0-beta.1v2.0.0-beta.2v2.0.0-beta.3v2.0.0-rc.1v2.0.0-rc.2v2.0.0-rc.3v2.0.0-rc.4v2.0.0-rc.5v2.0.0-rc.6v2.0.1v2.0.10v2.0.11v2.0.2v2.0.3v2.0.4v2.0.5v2.0.6v2.0.7v2.0.8v2.0.9v2.1.0v2.1.0-beta.1v2.1.0-beta.2v2.1.1v2.1.2v2.1.3v2.1.4v2.1.5v2.1.6v2.2.0v2.2.0-beta.1v2.2.0-beta.2v2.2.1v2.2.10v2.2.2v2.2.3v2.2.4v2.2.5 |
3.4.17 |
api-platform/corePackagist |
4.1.0-alpha.1 up to 4.1.5, plus listed versions v4.1.0v4.1.0-alpha.1v4.1.0-alpha.2v4.1.0-beta.1v4.1.0-beta.2 Show 4 moreShow lessv4.1.1v4.1.2v4.1.3v4.1.4 |
4.1.5 |
api-platform/graphqlPackagist |
4.1.0-alpha.1 up to 4.1.5, plus listed versions v4.1.0v4.1.0-alpha.1v4.1.0-alpha.2v4.1.0-beta.1v4.1.0-beta.2 Show 4 moreShow lessv4.1.1v4.1.2v4.1.3v4.1.4 |
4.1.5 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-31485 is a high vulnerability (CVSS 7.5) in Api-platform Core, published April 3, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.63%, the 50th percentile. Fixed in api-platform/graphql 3.4.17.
References
github.com/api-platform/core/security/advisories/GHSA-428q-q3vv-3fq3
github.com/api-platform/core/commit/7af65aad13037d7649348ee3dcd88e084ef771f8
github.com/api-platform/core/commit/cba3acfbd517763cf320167250c5bed6d569696a
github.com/api-platform/core/releases/tag/v3.4.17
nvd.nist.gov/vuln/detail/CVE-2025-31485
github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/core/CVE-2025-31485.yaml
Left out here: 202 versions. The JSON record has them.