CVE-2023-40180: Silverstripe/graphql Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-v23w-pppm-jh66
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2023-40180 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Silverstripe/graphql libraries in the Packagist ecosystem. The issue involves silverstripe graphql has ddos vulnerability due to lack of protection against recursive queries. Remediation is available by upgrading affected packages to version 3.8.2, 4.1.3, 4.2.5, 4.3.4, 5.0.3.

CVE-2023-40180 at a Glance

CVE Identifier CVE-2023-40180
GHSA Identifier GHSA-v23w-pppm-jh66
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Silverstripe/graphql
Package Ecosystem Packagist
Published Date
Last Updated

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:N/I:N/A:H).

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

How to Fix CVE-2023-40180

To remediate this vulnerability, upgrade all affected Silverstripe/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.

silverstripe/graphql fixed: 3.8.2
Upgrade silverstripe/graphql to 3.8.2
silverstripe/graphql fixed: 4.1.3
Upgrade silverstripe/graphql to 4.1.3
silverstripe/graphql fixed: 4.2.5
Upgrade silverstripe/graphql to 4.2.5
silverstripe/graphql fixed: 4.3.4
Upgrade silverstripe/graphql to 4.3.4
silverstripe/graphql fixed: 5.0.3
Upgrade silverstripe/graphql to 5.0.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for silverstripe/graphql

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-40180, inspect your project dependencies for Silverstripe/graphql:

inspect dependencies for silverstripe/graphql

Analyze the terminal output to locate any version of Silverstripe/graphql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.2), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Silverstripe/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 An attacker could use a recursive graphql query to execute a Distributed Denial of Service attack (DDOS attack) against a website. This mostly affects websites with publicly exposed graphql schemas. If your Silverstripe CMS project does not expose a public facing graphql schema, a user account is required to trigger the DDOS attack. If your site is hosted behind a content delivery network (CDN), such as Imperva or CloudFlare, this may further mitigate the risk. The fix includes some new configuration options which you might want to tweak for your project, based on your own requirements. See the documentation in the references for details. ### Patches Patched in [3.8.2](https://github.com/silverstripe/silverstripe-graphql/releases/tag/3.8.2), [4.1.3](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.1.3), [4.2.5](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.2.5), [4.3.4](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.3.4), [5.0.3](https://github.com/silverstripe/silverstripe-graphql/releases/tag/5.0.3) ### References - [CVE-2023-40180 on silverstripe.org](https://www.silverstripe.org/download/security-releases/CVE-2023-40180) - [Documentation about protection against recursive or complex queries for silverstripe/graphql 4.x/5.x](https://docs.silverstripe.org/en/developer_guides/graphql/security_and_best_practices/recursive_or_complex_queries) - [Documentation about protection against recursive or complex queries for silverstripe/graphql 3.x](https://github.com/silverstripe/silverstripe-graphql/tree/3.8#recursive-or-complex-queries) ### Reported by Jason Nguyen from phew (https://phew.co.nz/)

CVE-2023-40180 Affected Silverstripe/graphql Versions

5 component(s)
Fixed Versions:
3.8.24.1.34.2.54.3.45.0.3
Product / Package Ecosystem Affected Versions Fixed Version
silverstripe/graphql
Packagist
≥ 3.0.0
< 3.8.2
3.8.2
silverstripe/graphql
Packagist
≥ 4.0.0
< 4.1.3
4.1.3
silverstripe/graphql
Packagist
≥ 4.2.0
< 4.2.5
4.2.5
silverstripe/graphql
Packagist
≥ 4.3.0
< 4.3.4
4.3.4
silverstripe/graphql
Packagist
≥ 5.0.0
< 5.0.3
5.0.3

References

Frequently Asked Questions

What is CVE-2023-40180?
CVE-2023-40180 is a security vulnerability in Silverstripe/graphql involving Silverstripe GraphQL has DDOS Vulnerability due to lack of protection against recursive queries under CWE-400: Uncontrolled Resource Consumption.
Which Silverstripe/graphql versions are affected?
Affected versions include releases prior to 3.8.2, 4.1.3, 4.2.5, 4.3.4, 5.0.3 across affected packages: silverstripe/graphql.
What version fixes CVE-2023-40180?
Upgrading to 3.8.2, 4.1.3, 4.2.5, 4.3.4, 5.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is silverstripe/graphql affected?
Yes, silverstripe/graphql is affected in releases prior to 3.8.2, 4.1.3, 4.2.5, 4.3.4, 5.0.3. Upgrade your dependency to 3.8.2, 4.1.3, 4.2.5, 4.3.4, 5.0.3 or later.
What is the CVSS score of CVE-2023-40180?
CVE-2023-40180 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-40180?
CVE-2023-40180 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Packagist dependencies for CVE-2023-40180?
Run the dependency tree command: 'inspect dependencies for silverstripe/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-v23w-pppm-jh66",
  "modified" : "2023-10-17T13:48:17Z",
  "published" : "2023-10-17T13:48:17Z",
  "aliases" : [ "CVE-2023-40180" ],
  "summary" : "Silverstripe GraphQL has DDOS Vulnerability due to lack of protection against recursive queries",
  "details" : "### Impact\nAn attacker could use a recursive graphql query to execute a Distributed Denial of Service attack (DDOS attack) against a website. This mostly affects websites with publicly exposed graphql schemas.\n\nIf your Silverstripe CMS project does not expose a public facing graphql schema, a user account is required to trigger the DDOS attack. If your site is hosted behind a content delivery network (CDN), such as Imperva or CloudFlare, this may further mitigate the risk.\n\nThe fix includes some new configuration options which you might want to tweak for your project, based on your own requirements. See the documentation in the references for details.\n\n### Patches\nPatched in [3.8.2](https://github.com/silverstripe/silverstripe-graphql/releases/tag/3.8.2), [4.1.3](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.1.3), [4.2.5](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.2.5), [4.3.4](https://github.com/silverstripe/silverstripe-graphql/releases/tag/4.3.4), [5.0.3](https://github.com/silverstripe/silverstripe-graphql/releases/tag/5.0.3)\n\n### References\n- [CVE-2023-40180 on silverstripe.org](https://www.silverstripe.org/download/security-releases/CVE-2023-40180)\n- [Documentation about protection against recursive or complex queries for silverstripe/graphql 4.x/5.x](https://docs.silverstripe.org/en/developer_guides/graphql/security_and_best_practices/recursive_or_complex_queries)\n- [Documentation about protection against recursive or complex queries for silverstripe/graphql 3.x](https://github.com/silverstripe/silverstripe-graphql/tree/3.8#recursive-or-complex-queries)\n\n### Reported by\nJason Nguyen from phew (https://phew.co.nz/)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.8.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.2.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.3.0"
      }, {
        "fixed" : "4.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "silverstripe/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/silverstripe/silverstripe-graphql/security/advisories/GHSA-v23w-pppm-jh66"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40180"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/silverstripe/silverstripe-graphql/commit/f6d5976ec4608e51184b0db1ee5b9e9a99d2501c"
  }, {
    "type" : "WEB",
    "url" : "https://docs.silverstripe.org/en/developer_guides/graphql/security_and_best_practices/recursive_or_complex_queries"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/silverstripe/graphql/CVE-2023-40180.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/silverstripe/silverstripe-graphql"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/silverstripe/silverstripe-graphql/tree/3.8#recursive-or-complex-queries"
  }, {
    "type" : "WEB",
    "url" : "https://www.silverstripe.org/download/security-releases/CVE-2023-40180"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-17T13:48:17Z",
    "nvd_published_at" : "2023-10-16T19:15:10Z"
  }
}