CVE-2025-31485: Api platform/graphql GraphQL Grant On A Property Vulnerability
HIGHCVE-2025-31485 is a HIGH (CVSS 7.5) graphql grant on a property vulnerability (CWE-696: Incorrect Behavior Order) affecting Api platform/graphql libraries in the Packagist ecosystem. The issue involves graphql grant on a property might be cached with different objects. Remediation is available by upgrading affected packages to version 4.0.22, 3.4.17, 4.1.5.
CVE-2025-31485 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2025-31485
To remediate this vulnerability, upgrade all affected Api platform/graphql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade api-platform/graphql to 4.0.22
Upgrade api-platform/core to 4.0.22
Upgrade api-platform/graphql to 3.4.17
Upgrade api-platform/core to 3.4.17
Upgrade api-platform/core to 4.1.5
Upgrade api-platform/graphql to 4.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for api-platform/graphql
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-31485, inspect your project dependencies for Api platform/graphql:
inspect dependencies for api-platform/graphql
Analyze the terminal output to locate any version of Api platform/graphql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.22), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-696: Incorrect Behavior Order, where the product performs multiple related behaviors, but the behaviors are performed in the wrong order in ways that may produce resultant weaknesses. In Api platform/graphql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-31485 Affected Api platform/graphql Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
api-platform/graphql
|
Packagist |
≥ 4.0.0-alpha.1
< 4.0.22
|
4.0.22
|
|
api-platform/core
|
Packagist |
≥ 4.0.0-alpha.1
< 4.0.22
|
4.0.22
|
|
api-platform/graphql
|
Packagist |
< 3.4.17
|
3.4.17
|
|
api-platform/core
|
Packagist |
< 3.4.17
|
3.4.17
|
|
api-platform/core
|
Packagist |
≥ 4.1.0-alpha.1
< 4.1.5
|
4.1.5
|
|
api-platform/graphql
|
Packagist |
≥ 4.1.0-alpha.1
< 4.1.5
|
4.1.5
|
References
Frequently Asked Questions
What is CVE-2025-31485?
Which Api platform/graphql versions are affected?
What version fixes CVE-2025-31485?
Is api-platform/graphql affected?
Is api-platform/core affected?
What is the CVSS score of CVE-2025-31485?
What CWE is associated with CVE-2025-31485?
How can I check Packagist dependencies for CVE-2025-31485?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-428q-q3vv-3fq3",
"modified" : "2025-08-29T21:08:09Z",
"published" : "2025-04-04T14:19:42Z",
"aliases" : [ "CVE-2025-31485" ],
"summary" : "GraphQL grant on a property might be cached with different objects",
"details" : "### Original message:\n\nI found an issue with security grants on on properties in the GraphQL ItemNormalizer:\n\nIf 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.\n\nThere 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 \nand 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.\n\n### Impact\n\nIt grants access to properties that it should not.\n\n### Workarounds\n\nOverride the ItemNormalizer.\n\nPatched at: https://github.com/api-platform/core/commit/7af65aad13037d7649348ee3dcd88e084ef771f8",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/graphql"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0-alpha.1"
}, {
"fixed" : "4.0.22"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0-alpha.1"
}, {
"fixed" : "4.0.22"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/graphql"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.17"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.17"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.1.0-alpha.1"
}, {
"fixed" : "4.1.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "api-platform/graphql"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.1.0-alpha.1"
}, {
"fixed" : "4.1.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/api-platform/core/security/advisories/GHSA-428q-q3vv-3fq3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-31485"
}, {
"type" : "WEB",
"url" : "https://github.com/api-platform/core/commit/7af65aad13037d7649348ee3dcd88e084ef771f8"
}, {
"type" : "WEB",
"url" : "https://github.com/api-platform/core/commit/cba3acfbd517763cf320167250c5bed6d569696a"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/core/CVE-2025-31485.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/api-platform/graphql/CVE-2025-31485.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/api-platform/core"
}, {
"type" : "WEB",
"url" : "https://github.com/api-platform/core/releases/tag/v3.4.17"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-696" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-04T14:19:42Z",
"nvd_published_at" : "2025-04-03T20:15:25Z"
}
}