GHSA-224p-v68g-5g8f: @escape.tech/graphql armor max depth GraphQL Armor Max-Depth Plugin Bypass Vulnerability

MODERATE
CVSS 5.3
CWE-400
Published
Advisory Summary

GHSA-224p-v68g-5g8f is a MODERATE (CVSS 5.3) graphql armor max-depth plugin bypass vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting @escape.tech/graphql armor max depth libraries in the npm ecosystem. The issue involves graphql armor max-depth plugin bypass via fragment caching. Remediation is available by upgrading affected packages to version 2.4.2.

GHSA-224p-v68g-5g8f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-224p-v68g-5g8f
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product @escape.tech/graphql armor max depth
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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 Low (A:L)

How to Fix GHSA-224p-v68g-5g8f

To remediate this vulnerability, upgrade all affected @escape.tech/graphql armor max depth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@escape.tech/graphql-armor-max-depth fixed: 2.4.2
npm install @escape.tech/graphql-armor-max-depth@2.4.2
Verify Direct and Transitive Dependencies

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

npm ls @escape.tech/graphql-armor-max-depth

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-224p-v68g-5g8f, inspect your project dependencies using npm:

npm ls @escape.tech/graphql-armor-max-depth

Analyze the terminal output to locate any version of @escape.tech/graphql armor max depth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.2), your application is affected.

Note: The npm ls @escape.tech/graphql-armor-max-depth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 @escape.tech/graphql armor max depth, 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

### Summary A query depth restriction using the max-depth can be bypassed if `ignoreIntrospection` is enabled (which is the default configuration) by naming your query/fragment `__schema`. ### Details In the `countDepth` function, we have the following code that calculates the depth of a used fragment: ```typescript } else if (node.kind == Kind.FRAGMENT_SPREAD) { if (this.visitedFragments.has(node.name.value)) { return this.visitedFragments.get(node.name.value) ?? 0; } else { this.visitedFragments.set(node.name.value, -1); } const fragment = this.context.getFragment(node.name.value); if (fragment) { let fragmentDepth; if (this.config.flattenFragments) { fragmentDepth = this.countDepth(fragment, parentDepth); } else { fragmentDepth = this.countDepth(fragment, parentDepth + 1); } depth = Math.max(depth, fragmentDepth); if (this.visitedFragments.get(node.name.value) === -1) { this.visitedFragments.set(node.name.value, fragmentDepth); } } } ``` which will calculate the depth of the fragment used in the current node, store the value in `this.visitedFragments` and re-use it in the future to avoid re-calculating the depth for the same fragment. The issue arises when the same fragment is used multiple times, **at different depths**. The current caching takes into account the depth of the first occurrence, which means if the fragment is re-used later in a higher depth, this cached value is not updated. So, for example, sending the following query with a max depth of `6`: ```graphql query { books { author { ...Test } } books { author { books { author { ...Test } } } } } fragment Test on Author { books { title } } ``` The first use of `Test` fragment does not exceed the defined limit, and this depth will be cached. In the second use, the fragment is reused in a greater depth, but the `countDepth` function will still use the depth cached, without accounting for the increased depth. ### PoC Max depth: `6` ```graphql query { books { author { ...Test } } books { author { books { author { ...Test } } } } } fragment Test on Author { books { title } } ``` ### Impact This issue affects applications using the GraphQL Armor Depth Limit plugin. ### Fix This is fixed in [PR#824](https://github.com/Escape-Technologies/graphql-armor/pull/824). We now store only the additional depth contributed by the fragment and add it to the parent depth where the fragment is used (`parentDepth`).

GHSA-224p-v68g-5g8f Affected @escape.tech/graphql armor max depth Versions

1 component(s)
Fixed Versions:
2.4.2
Product / Package Ecosystem Affected Versions Fixed Version
@escape.tech/graphql-armor-max-depth
npm
< 2.4.2
2.4.2

References

Frequently Asked Questions

What is GHSA-224p-v68g-5g8f?
GHSA-224p-v68g-5g8f is a security vulnerability in @escape.tech/graphql armor max depth involving GraphQL Armor Max-Depth Plugin Bypass via fragment caching under CWE-400: Uncontrolled Resource Consumption.
Which @escape.tech/graphql armor max depth versions are affected?
Affected versions include releases prior to 2.4.2 across affected packages: @escape.tech/graphql-armor-max-depth.
What version fixes GHSA-224p-v68g-5g8f?
Upgrading to 2.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @escape.tech/graphql-armor-max-depth affected?
Yes, @escape.tech/graphql-armor-max-depth is affected in releases prior to 2.4.2. Upgrade your dependency to 2.4.2 or later.
What is the CVSS score of GHSA-224p-v68g-5g8f?
GHSA-224p-v68g-5g8f has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-224p-v68g-5g8f?
GHSA-224p-v68g-5g8f 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 npm dependencies for GHSA-224p-v68g-5g8f?
Run the dependency tree command: 'npm ls @escape.tech/graphql-armor-max-depth'. 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-224p-v68g-5g8f",
  "modified" : "2025-08-26T18:45:55Z",
  "published" : "2025-08-26T18:45:55Z",
  "aliases" : [ ],
  "summary" : "GraphQL Armor Max-Depth Plugin Bypass via fragment caching",
  "details" : "### Summary\nA query depth restriction using the max-depth can be bypassed if `ignoreIntrospection` is enabled (which is the default configuration) by naming your query/fragment `__schema`.\n\n### Details\nIn the `countDepth` function, we have the following code that calculates the depth of a used fragment:\n\n```typescript\n    } else if (node.kind == Kind.FRAGMENT_SPREAD) {\n      if (this.visitedFragments.has(node.name.value)) {\n        return this.visitedFragments.get(node.name.value) ?? 0;\n      } else {\n        this.visitedFragments.set(node.name.value, -1);\n      }\n      const fragment = this.context.getFragment(node.name.value);\n      if (fragment) {\n        let fragmentDepth;\n        if (this.config.flattenFragments) {\n          fragmentDepth = this.countDepth(fragment, parentDepth);\n        } else {\n          fragmentDepth = this.countDepth(fragment, parentDepth + 1);\n        }\n        depth = Math.max(depth, fragmentDepth);\n        if (this.visitedFragments.get(node.name.value) === -1) {\n          this.visitedFragments.set(node.name.value, fragmentDepth);\n        }\n      }\n    }\n```\n\nwhich will calculate the depth of the fragment used in the current node, store the value in `this.visitedFragments` and re-use it in the future to avoid re-calculating the depth for the same fragment.\n\nThe issue arises when the same fragment is used multiple times, **at different depths**. The current caching takes into account the depth of the first occurrence, which means if the fragment is re-used later in a higher depth, this cached value is not updated.\n\nSo, for example, sending the following query with a max depth of `6`:\n\n```graphql\nquery {\n  books {\n    author {\n      ...Test\n    }\n  }\n  books {\n    author {\n      books {\n        author {\n          ...Test\n        }\n      }\n    }\n  }\n}\nfragment Test on Author {\n  books {\n    title\n  }\n}\n```\n\nThe first use of `Test` fragment does not exceed the defined limit, and this depth will be cached.\n\nIn the second use, the fragment is reused in a greater depth, but the `countDepth` function will still use the depth cached, without accounting for the increased depth.\n\n### PoC\n\nMax depth: `6`\n\n```graphql\nquery {\n  books {\n    author {\n      ...Test\n    }\n  }\n  books {\n    author {\n      books {\n        author {\n          ...Test\n        }\n      }\n    }\n  }\n}\nfragment Test on Author {\n  books {\n    title\n  }\n}\n```\n\n### Impact\n\nThis issue affects applications using the GraphQL Armor Depth Limit plugin.\n\n### Fix\n\nThis is fixed in [PR#824](https://github.com/Escape-Technologies/graphql-armor/pull/824). We now store only the additional depth contributed by the fragment and add it to the parent depth where the fragment is used (`parentDepth`).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@escape.tech/graphql-armor-max-depth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.4.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Escape-Technologies/graphql-armor/security/advisories/GHSA-224p-v68g-5g8f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Escape-Technologies/graphql-armor/pull/824"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Escape-Technologies/graphql-armor/commit/998986109f8c2313bd61325ddfe7f5dcd48f9232"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Escape-Technologies/graphql-armor"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-26T18:45:55Z",
    "nvd_published_at" : null
  }
}