CVE-2024-47082: Strawberry graphql Cross-Site Request Forgery (CSRF) Vulnerability

MODERATE
Advisory Identifier: GHSA-79gp-q4wv-33fr
CVSS 4.6
CWE-352
Published
Advisory Summary

CVE-2024-47082 is a MODERATE (CVSS 4.6) cross-site request forgery (csrf) vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Strawberry graphql libraries in the PyPI ecosystem. The issue involves cross-site request forgery (csrf) in strawberry-graphql. Remediation is available by upgrading affected packages to version 0.243.0.

CVE-2024-47082 at a Glance

CVE Identifier CVE-2024-47082
GHSA Identifier GHSA-79gp-q4wv-33fr
Severity MODERATE
CVSS v3.1 Base Score 4.6
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Strawberry graphql
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-47082

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.

strawberry-graphql fixed: 0.243.0
pip install strawberry-graphql>=0.243.0
Verify Direct and Transitive Dependencies

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-2024-47082, 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.243.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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. 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

### Impact Multipart file upload support as defined in the [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec) was enabled by default in all Strawberry HTTP view integrations. This made all Strawberry HTTP view integrations vulnerable to CSRF attacks if users did not explicitly enable CSRF preventing security mechanism for their servers. Additionally, the Django HTTP view integration, in particular, had an exemption for Django's built-in CSRF protection (i.e., the `CsrfViewMiddleware` middleware) by default. In affect, all Strawberry integrations were vulnerable to CSRF attacks by default. ### Patches Version `v0.243.0` is the first `strawberry-graphql` including a patch. Check out our [documentation](https://strawberry.rocks/docs/breaking-changes/0.243.0) for additional details and upgrade instructions. ### References - [Strawberry upgrade guide](https://strawberry.rocks/docs/breaking-changes/0.243.0) - [Multipart Upload Security Implications](https://github.com/jaydenseric/graphql-multipart-request-spec/blob/master/readme.md#security) ### Credits - [Thomas Grainger](https://github.com/graingert) - [Arthur Bayr](https://github.com/speedy1991) - [Jonathan Ehwald](https://github.com/DoctorJohn)

CVE-2024-47082 Affected Strawberry graphql Versions

1 component(s)
Fixed Versions:
0.243.0
Product / Package Ecosystem Affected Versions Fixed Version
strawberry-graphql
PyPI
< 0.243.0
0.243.0

References

Frequently Asked Questions

What is CVE-2024-47082?
CVE-2024-47082 is a security vulnerability in Strawberry graphql involving Cross-Site Request Forgery (CSRF) in strawberry-graphql under CWE-352: Cross-Site Request Forgery (CSRF).
Which Strawberry graphql versions are affected?
Affected versions include releases prior to 0.243.0 across affected packages: strawberry-graphql.
What version fixes CVE-2024-47082?
Upgrading to 0.243.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is strawberry-graphql affected?
Yes, strawberry-graphql is affected in releases prior to 0.243.0. Upgrade your dependency to 0.243.0 or later.
What is the CVSS score of CVE-2024-47082?
CVE-2024-47082 has a CVSS v3.1 base score of 4.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2024-47082?
CVE-2024-47082 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2024-47082?
Run the dependency tree command: 'pip show strawberry-graphql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-79gp-q4wv-33fr",
  "modified" : "2025-01-21T18:27:00Z",
  "published" : "2024-09-25T18:21:19Z",
  "aliases" : [ "CVE-2024-47082" ],
  "summary" : "Cross-Site Request Forgery (CSRF) in strawberry-graphql",
  "details" : "### Impact\n\nMultipart file upload support as defined in the [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec) was enabled by default in all Strawberry HTTP view integrations. This made all Strawberry HTTP view integrations vulnerable to CSRF attacks if users did not explicitly enable CSRF preventing security mechanism for their servers.\nAdditionally, the Django HTTP view integration, in particular, had an exemption for Django's built-in CSRF protection (i.e., the `CsrfViewMiddleware` middleware) by default.\n\nIn affect, all Strawberry integrations were vulnerable to CSRF attacks by default.\n\n### Patches\n\nVersion `v0.243.0` is the first `strawberry-graphql` including a patch. Check out our [documentation](https://strawberry.rocks/docs/breaking-changes/0.243.0) for additional details and upgrade instructions.\n\n### References\n\n- [Strawberry upgrade guide](https://strawberry.rocks/docs/breaking-changes/0.243.0)\n- [Multipart Upload Security Implications](https://github.com/jaydenseric/graphql-multipart-request-spec/blob/master/readme.md#security)\n\n### Credits\n\n- [Thomas Grainger](https://github.com/graingert)\n- [Arthur Bayr](https://github.com/speedy1991)\n- [Jonathan Ehwald](https://github.com/DoctorJohn)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "strawberry-graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.243.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strawberry-graphql/strawberry/security/advisories/GHSA-79gp-q4wv-33fr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47082"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strawberry-graphql/strawberry/commit/37265b230e511480a9ceace492f9f6a484be1387"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/strawberry-graphql/PYSEC-2024-171.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/strawberry-graphql/strawberry"
  }, {
    "type" : "WEB",
    "url" : "https://strawberry.rocks/docs/breaking-changes/0.243.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-25T18:21:19Z",
    "nvd_published_at" : "2024-09-25T18:15:05Z"
  }
}