CVE-2025-31481
GraphQL query operations security can be bypassed
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Using the Relay special node type you can bypass the configured security on an operation. 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 query operations security can be bypassed
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Using the Relay special node type you can bypass the configured security on an operation. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31481- 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-863
- Updated
- 2026-11-02
EUVDEUVD-2025-9737
7.5
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Using the Relay special node type you can bypass the configured security on an operation. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
EUVD-2025-9737- 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-cg3c-245w-728m
7.5
GraphQL query operations security can be bypassed
Summary
Using the Relay special node type you can bypass the configured security on an operation.
Details
Here is an example of how to apply security configurations for the GraphQL operations:
#[ApiResource(
security: "is_granted('ROLE_USER')",
operations: [ /* ... */ ],
graphQlOperations: [
new Query(security: "is_granted('ROLE_USER')"),
//...
],
)]
class Book { /* ... */ }
This indeed checks is_granted('ROLE_USER') as expected for a GraphQL query like the following:
query {
book(id: "/books/1") {
title
}
}
But the security check can be bypassed by using the node field (that is available by default) on the root query type like that:
query {
node(id: "/books/1") {
... on Book {
title
}
}
}
This does not execute any security checks and can therefore be used to access any entity without restrictions by everyone that has access to the API.
Impact
Everyone using GraphQl with the security attribute. Not sure whereas this works with custom resolvers nor if this also applies on mutation.
Patched at https://github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568
- Record
GHSA-cg3c-245w-728m- 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-863
- Updated
- 2026-11-02
NVD
7.5
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Using the Relay special node type you can bypass the configured security on an operation. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31481- 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-863
- Updated
- 2026-11-02
OSV
7.5
GraphQL query operations security can be bypassed
API Platform Core is a system to create hypermedia-driven REST and GraphQL APIs. Using the Relay special node type you can bypass the configured security on an operation. This vulnerability is fixed in 4.0.22 and 3.4.17.
- Record
CVE-2025-31481- 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-863
- Updated
- 2026-11-02
OSVGHSA-cg3c-245w-728m
7.5
GraphQL query operations security can be bypassed
Summary
Using the Relay special node type you can bypass the configured security on an operation.
Details
Here is an example of how to apply security configurations for the GraphQL operations:
#[ApiResource(
security: "is_granted('ROLE_USER')",
operations: [ /* ... */ ],
graphQlOperations: [
new Query(security: "is_granted('ROLE_USER')"),
//...
],
)]
class Book { /* ... */ }
This indeed checks is_granted('ROLE_USER') as expected for a GraphQL query like the following:
query {
book(id: "/books/1") {
title
}
}
But the security check can be bypassed by using the node field (that is available by default) on the root query type like that:
query {
node(id: "/books/1") {
... on Book {
title
}
}
}
This does not execute any security checks and can therefore be used to access any entity without restrictions by everyone that has access to the API.
Impact
Everyone using GraphQl with the security attribute. Not sure whereas this works with custom resolvers nor if this also applies on mutation.
Patched at https://github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568
- Record
GHSA-cg3c-245w-728m- 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-863
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
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/graphqlPackagist |
before 3.4.17 | 3.4.17 |
api-platform/corePackagist |
before 3.4.17 | 3.4.17 |
api-platform/graphqlPackagist |
4.1.0-alpha.1 up to 4.1.5 | 4.1.5 |
api-platform/corePackagist |
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/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 |
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 |
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-31481 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.47%, the 41st percentile. Fixed in api-platform/graphql 4.0.22.
References
github.com/api-platform/core/security/advisories/GHSA-cg3c-245w-728m
github.com/api-platform/core/commit/55712452b4f630978537bdb2a07dc958202336bb
github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568
github.com/api-platform/core/releases/tag/v3.4.17
nvd.nist.gov/vuln/detail/CVE-2025-31481
github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/core/CVE-2025-31481.yaml
Show 5 moreShow less
Left out here: 202 versions. The JSON record has them.