CVE-2025-22151: Strawberry graphql Strawberry GraphQL Has Type Resolution Vulnerability
LOWCVE-2025-22151 is a LOW (CVSS 3.7) strawberry graphql has type resolution vulnerability (CWE-351: Insufficient Type Distinction) affecting Strawberry graphql libraries in the PyPI ecosystem. The issue involves strawberry graphql has type resolution vulnerability in node interface that allows potential data leakage through incorrect type resolution. Remediation is available by upgrading affected packages to version 0.257.0.
CVE-2025-22151 at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2025-22151
To remediate this vulnerability, upgrade all affected Strawberry 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.
pip install strawberry-graphql>=0.257.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show strawberry-graphql
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-22151, inspect your installed packages using pip:
pip show strawberry-graphql
Analyze the terminal output to locate any version of Strawberry graphql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.257.0), your application is affected.
Note: The pip show strawberry-graphql command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-351: Insufficient Type Distinction, where the product does not properly distinguish between different types of elements in a way that leads to insecure behavior. In Strawberry 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-22151 Affected Strawberry graphql Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
strawberry-graphql
|
PyPI |
≥ 0.182.0
< 0.257.0
|
0.257.0
|
References
Frequently Asked Questions
What is CVE-2025-22151?
Which Strawberry graphql versions are affected?
What version fixes CVE-2025-22151?
Is strawberry-graphql affected?
What is the CVSS score of CVE-2025-22151?
What CWE is associated with CVE-2025-22151?
How can I check PyPI dependencies for CVE-2025-22151?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5xh2-23cc-5jc6",
"modified" : "2025-01-09T22:04:49Z",
"published" : "2025-01-09T18:51:51Z",
"aliases" : [ "CVE-2025-22151" ],
"summary" : "Strawberry GraphQL has type resolution vulnerability in node interface that allows potential data leakage through incorrect type resolution",
"details" : "**Vulnerability Summary**\nA type confusion vulnerability exists in Strawberry GraphQL's relay integration that affects multiple ORM integrations (Django, SQLAlchemy, Pydantic). The vulnerability occurs when multiple GraphQL types are mapped to the same underlying model while using the relay `node` interface.\n\n**Affected Components**\n- Strawberry GraphQL relay integration\n- Specifically impacts implementations using:\n - Django integration\n - SQLAlchemy integration\n - Pydantic integration\n\n**Technical Details**\n\nThe vulnerability manifests when:\n1. Multiple GraphQL types inherit from `relay.Node`\n2. These types are mapped to the same database model\n3. The global `node` field is used for type resolution\n\nExample of vulnerable code:\n\n```python\nfrom fruits.models import Fruit\nimport strawberry_django\nimport strawberry\n\n@strawberry_django.type(Fruit)\nclass FruitType(relay.Node):\n name: strawberry.auto\n\n@strawberry_django.type(Fruit)\nclass SpecialFruitType(relay.Node):\n secret_name: strawberry.auto\n\n@strawberry.type\nclass Query:\n node: relay.Node = strawberry_django.node()\n```\n\n**Security Impact**\n\nWhen querying for a specific type using the global `node` field (e.g., `FruitType:some-id`), the resolver may incorrectly return an instance of a different type mapped to the same model (e.g., `SpecialFruitType`). This can lead to:\n\n1. Information disclosure if the alternate type exposes sensitive fields\n2. Potential privilege escalation if the alternate type contains data intended for restricted access\n\n**Note**\nEven with knowledge of the correct type name (e.g., `SpecialFruitType`), attackers may still be able to access unauthorized data through direct type queries.\n\nWe recommend to use permission on fields instead of creating a dedicate type.\n\n**Recommendations**\n1. Avoid mapping multiple relay Node types to the same model\n2. Implement strict access controls at the field resolution level (using permissions)\n3. Consider using separate models for different access levels of the same data\n4. Update to `strawberry-graphql>=0.257.0`\n5. If using `strawberry-graphql-django`, update to `strawberry-graphql-django>=0.54.0`",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "strawberry-graphql"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.182.0"
}, {
"fixed" : "0.257.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/strawberry-graphql/strawberry/security/advisories/GHSA-5xh2-23cc-5jc6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-22151"
}, {
"type" : "WEB",
"url" : "https://github.com/strawberry-graphql/strawberry/commit/526eb82b70451c0e59d5a71ae9b7396f59974bd8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/strawberry-graphql/strawberry"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-351", "CWE-843" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-09T18:51:51Z",
"nvd_published_at" : "2025-01-09T19:15:20Z"
}
}