{"id":"CVE-2025-31481","aliases":["EUVD-2025-9737","GHSA-cg3c-245w-728m"],"status":"published","title":"GraphQL query operations security can be bypassed","description":"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.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00475,"percentile":0.41385,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-863"],"published":"2025-04-03T19:20:22Z","modified":"2026-10-28T02:30:38Z","fixes":[{"ecosystem":"Packagist","package":"api-platform/graphql","fixed_in":["4.0.22","3.4.17","4.1.5"],"sources":["ghsa","osv"]},{"ecosystem":"Packagist","package":"api-platform/core","fixed_in":["4.0.22","3.4.17","4.1.5"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0-alpha.1"},{"fixed":"4.0.22"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0-alpha.1"},{"fixed":"4.0.22"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.17"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.17"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0-alpha.1"},{"fixed":"4.1.5"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0-alpha.1"},{"fixed":"4.1.5"}]}]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0-alpha.1"},{"fixed":"4.0.22"}]}],"versions":["v4.0.0","v4.0.0-alpha.1","v4.0.0-alpha.2","v4.0.0-alpha.3","v4.0.0-alpha.4","v4.0.0-alpha.5","v4.0.0-alpha.6","v4.0.0-alpha.7","v4.0.0-beta.1","v4.0.0-beta.2","v4.0.1","v4.0.10","v4.0.11","v4.0.12","v4.0.13","v4.0.14","v4.0.15","v4.0.16","v4.0.17","v4.0.18","v4.0.19","v4.0.2","v4.0.20","v4.0.21","v4.0.3","v4.0.4","v4.0.5","v4.0.6","v4.0.7","v4.0.8","v4.0.9"]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0-alpha.1"},{"fixed":"4.0.22"}]}],"versions":["v4.0.0","v4.0.0-alpha.1","v4.0.0-alpha.2","v4.0.0-alpha.3","v4.0.0-alpha.4","v4.0.0-alpha.5","v4.0.0-alpha.6","v4.0.0-alpha.7","v4.0.0-beta.1","v4.0.0-beta.2","v4.0.1","v4.0.10","v4.0.11","v4.0.12","v4.0.13","v4.0.14","v4.0.15","v4.0.16","v4.0.17","v4.0.18","v4.0.19","v4.0.2","v4.0.20","v4.0.21","v4.0.3","v4.0.4","v4.0.5","v4.0.6","v4.0.7","v4.0.8","v4.0.9"]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.17"}]}],"versions":["v3.2.0-beta.1","v3.2.1","v3.2.10","v3.2.11","v3.2.12","v3.2.2","v3.2.25","v3.2.3","v3.2.4","v3.2.5","v3.2.6","v3.2.7","v3.2.8","v3.2.9","v3.3.0-alpha.1","v3.3.0-beta.1","v3.3.11","v3.3.13","v3.3.14","v3.3.15","v3.3.3","v3.3.4","v3.3.6","v3.3.7","v3.3.8","v3.3.9","v3.4.0","v3.4.0-alpha.1","v3.4.0-alpha.2","v3.4.0-alpha.3","v3.4.0-alpha.4","v3.4.0-alpha.5","v3.4.0-alpha.6","v3.4.0-alpha.7","v3.4.0-beta.1","v3.4.1","v3.4.10","v3.4.11","v3.4.13","v3.4.14","v3.4.15","v3.4.16","v3.4.2","v3.4.3","v3.4.4","v3.4.5","v3.4.6","v3.4.7","v3.4.8","v3.4.9"]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.17"}]}],"versions":["v1.0.0","v1.0.0-beta","v1.0.0-beta.2","v1.0.0-beta.3","v1.0.1","v1.1.0","v1.1.0-beta.1","v1.1.0-beta.2","v1.1.1","v2.0.0","v2.0.0-alpha.1","v2.0.0-alpha.2","v2.0.0-beta.1","v2.0.0-beta.2","v2.0.0-beta.3","v2.0.0-rc.1","v2.0.0-rc.2","v2.0.0-rc.3","v2.0.0-rc.4","v2.0.0-rc.5","v2.0.0-rc.6","v2.0.1","v2.0.10","v2.0.11","v2.0.2","v2.0.3","v2.0.4","v2.0.5","v2.0.6","v2.0.7","v2.0.8","v2.0.9","v2.1.0","v2.1.0-beta.1","v2.1.0-beta.2","v2.1.1","v2.1.2","v2.1.3","v2.1.4","v2.1.5","v2.1.6","v2.2.0","v2.2.0-beta.1","v2.2.0-beta.2","v2.2.1","v2.2.10","v2.2.2","v2.2.3","v2.2.4","v2.2.5","v2.2.6","v2.2.7","v2.2.8","v2.2.9","v2.3.0","v2.3.0-beta.1","v2.3.1","v2.3.2","v2.3.3","v2.3.4","v2.3.5","v2.3.6","v2.4.0","v2.4.0-beta.1","v2.4.0-beta.2","v2.4.1","v2.4.2","v2.4.3","v2.4.4","v2.4.5","v2.4.6","v2.4.7","v2.5.0","v2.5.0-beta.1","v2.5.0-beta.2","v2.5.1","v2.5.10","v2.5.2","v2.5.3","v2.5.4","v2.5.5","v2.5.6","v2.5.7","v2.5.8","v2.5.9","v2.6.0","v2.6.0-alpha.1","v2.6.0-beta.1","v2.6.1","v2.6.2","v2.6.3","v2.6.3-alpha.1","v2.6.3.alpha","v2.6.4","v2.6.5","v2.6.6","v2.6.7","v2.6.8","v2.7.0","v2.7.0-alpha.1","v2.7.0-alpha.2","v2.7.0-alpha.3","v2.7.0-alpha.4","v2.7.0-alpha.5","v2.7.0-alpha.6","v2.7.0-alpha.7","v2.7.0-beta.1","v2.7.0-beta.2","v2.7.0-beta.3","v2.7.0-beta.4","v2.7.0-beta.5","v2.7.0-rc.1","v2.7.0-rc.2","v2.7.1","v2.7.10","v2.7.11","v2.7.12","v2.7.13","v2.7.14","v2.7.15","v2.7.16","v2.7.17","v2.7.18","v2.7.2","v2.7.3","v2.7.4","v2.7.5","v2.7.6","v2.7.7","v2.7.8","v2.7.9","v3.0.0","v3.0.0-beta.1","v3.0.0-beta.2","v3.0.0-rc.1","v3.0.0-rc.2","v3.0.1","v3.0.10","v3.0.11","v3.0.12","v3.0.2","v3.0.3","v3.0.4","v3.0.5","v3.0.6","v3.0.7","v3.0.8","v3.0.9","v3.1.0","v3.1.1","v3.1.10","v3.1.11","v3.1.12","v3.1.13","v3.1.14","v3.1.15","v3.1.16","v3.1.17","v3.1.18","v3.1.19","v3.1.2","v3.1.20","v3.1.21","v3.1.22","v3.1.23","v3.1.24","v3.1.25","v3.1.26","v3.1.27","v3.1.28","v3.1.29","v3.1.3","v3.1.4","v3.1.5","v3.1.6","v3.1.7","v3.1.8","v3.1.9","v3.2.0","v3.2.0-alpha.1","v3.2.0-alpha.2","v3.2.0-beta.1","v3.2.0-beta.2","v3.2.1","v3.2.10","v3.2.11","v3.2.12","v3.2.13","v3.2.14","v3.2.15","v3.2.16","v3.2.17","v3.2.18","v3.2.19","v3.2.2","v3.2.20","v3.2.21","v3.2.22","v3.2.23","v3.2.24","v3.2.25","v3.2.26","v3.2.3","v3.2.4","v3.2.5","v3.2.6","v3.2.7","v3.2.8","v3.2.9","v3.3.0","v3.3.0-alpha.1","v3.3.0-alpha.2","v3.3.0-beta.1","v3.3.0-beta.2","v3.3.1","v3.3.10","v3.3.11","v3.3.12","v3.3.13","v3.3.14","v3.3.15","v3.3.2","v3.3.3","v3.3.4","v3.3.5","v3.3.6","v3.3.7","v3.3.8","v3.3.9","v3.4.0","v3.4.0-alpha.1","v3.4.0-alpha.2","v3.4.0-alpha.3","v3.4.0-alpha.4","v3.4.0-alpha.5","v3.4.0-alpha.6","v3.4.0-alpha.7","v3.4.0-beta.1","v3.4.1","v3.4.10","v3.4.11","v3.4.14","v3.4.15","v3.4.16","v3.4.2","v3.4.3","v3.4.4","v3.4.5","v3.4.6","v3.4.7","v3.4.8","v3.4.9"]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/graphql","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0-alpha.1"},{"fixed":"4.1.5"}]}],"versions":["v4.1.0","v4.1.0-alpha.1","v4.1.0-alpha.2","v4.1.0-beta.1","v4.1.0-beta.2","v4.1.1","v4.1.2","v4.1.3","v4.1.4"]},{"source":"osv","ecosystem":"Packagist","package":"api-platform/core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0-alpha.1"},{"fixed":"4.1.5"}]}],"versions":["v4.1.0","v4.1.0-alpha.1","v4.1.0-alpha.2","v4.1.0-beta.1","v4.1.0-beta.2","v4.1.1","v4.1.2","v4.1.3","v4.1.4"]}],"products":[{"vendor":"api-platform","product":"core"},{"vendor":"opnsense","product":"core"}],"references":[{"url":"https://github.com/api-platform/core/security/advisories/GHSA-cg3c-245w-728m","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/api-platform/core/commit/55712452b4f630978537bdb2a07dc958202336bb","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/api-platform/core/releases/tag/v3.4.17","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-31481","tags":["advisory"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/core/CVE-2025-31481.yaml","tags":["web"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/graphql/CVE-2025-31481.yaml","tags":["web"]},{"url":"https://github.com/api-platform/core/releases/tag/v4.1.5","tags":["web"]},{"url":"https://github.com/advisories/GHSA-cg3c-245w-728m"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/31xxx/CVE-2025-31481.json","tags":["advisory"]},{"url":"https://github.com/api-platform/core","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-31481","title":"GraphQL query operations security can be bypassed","description":"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.","status":"published","published":"2025-04-03T19:20:22.916Z","modified":"2025-04-08T13:14:36.379Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:32:44.424933Z"}],"euvd":[{"id":"EUVD-2025-9737","description":"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.","status":"published","published":"2025-04-03T19:20:22Z","modified":"2025-04-08T13:14:36Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T20:52:40.600826Z"}],"ghsa":[{"id":"GHSA-cg3c-245w-728m","title":"GraphQL query operations security can be bypassed","description":"### Summary\n\nUsing the Relay special `node` type you can bypass the configured security on an operation.\n\n### Details\n\nHere is an example of how to apply security configurations for the GraphQL operations:\n\n```php\n#[ApiResource(\n    security: \"is_granted('ROLE_USER')\",\n    operations: [ /* ... */ ],\n    graphQlOperations: [\n        new Query(security: \"is_granted('ROLE_USER')\"),\n        //...\n    ],\n)]\nclass Book { /* ... */ }\n```\n\nThis indeed checks `is_granted('ROLE_USER')` as expected for a GraphQL query like the following:\n\n```php\n‌query {\n    book(id: \"/books/1\") {\n        title\n    }\n}\n```\n\nBut the security check can be bypassed by using the `node` field (that is available by default) on the root query type like that:\n\n```php\n‌query {\n    node(id: \"/books/1\") {\n        ... on Book {\n            title\n        }\n    }\n}\n```\n\nThis 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.\n\n### Impact\n\nEveryone using GraphQl with the `security` attribute. Not sure whereas this works with custom resolvers nor if this also applies on mutation.\n\nPatched at https://github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568","status":"published","published":"2025-04-04T14:07:20Z","modified":"2025-08-29T21:07:09Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:38:55.953734Z"}],"nvd":[{"id":"CVE-2025-31481","description":"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.","status":"published","published":"2025-04-03T20:15:25.543Z","modified":"2026-06-17T09:10:28.647Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"secondary"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T14:10:58.094557Z"}],"osv":[{"id":"CVE-2025-31481","title":"GraphQL query operations security can be bypassed","description":"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.","status":"published","published":"2025-04-03T19:20:22.916Z","modified":"2026-10-28T02:30:38.204850939Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T15:44:48.02508Z"},{"id":"GHSA-cg3c-245w-728m","title":"GraphQL query operations security can be bypassed","description":"### Summary\n\nUsing the Relay special `node` type you can bypass the configured security on an operation.\n\n### Details\n\nHere is an example of how to apply security configurations for the GraphQL operations:\n\n```php\n#[ApiResource(\n    security: \"is_granted('ROLE_USER')\",\n    operations: [ /* ... */ ],\n    graphQlOperations: [\n        new Query(security: \"is_granted('ROLE_USER')\"),\n        //...\n    ],\n)]\nclass Book { /* ... */ }\n```\n\nThis indeed checks `is_granted('ROLE_USER')` as expected for a GraphQL query like the following:\n\n```php\n‌query {\n    book(id: \"/books/1\") {\n        title\n    }\n}\n```\n\nBut the security check can be bypassed by using the `node` field (that is available by default) on the root query type like that:\n\n```php\n‌query {\n    node(id: \"/books/1\") {\n        ... on Book {\n            title\n        }\n    }\n}\n```\n\nThis 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.\n\n### Impact\n\nEveryone using GraphQl with the `security` attribute. Not sure whereas this works with custom resolvers nor if this also applies on mutation.\n\nPatched at https://github.com/api-platform/core/commit/60747cc8c2fb855798c923b5537888f8d0969568","status":"published","published":"2025-04-04T14:07:20Z","modified":"2025-08-29T21:35:33.406512Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-863"],"updated_at":"2026-11-02T15:46:44.927642Z"}]}}
