{"id":"GHSA-hmfr-rx46-4jx2","aliases":[],"status":"published","title":"GraphQL Armor Max-Depth Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query depth restriction using the `max-depth` property can be bypassed if `ignoreIntrospection` is enabled (which is the default configuration) by naming your query/fragment `__schema`.\n\n### Details\nAt the start of the `countDepth` function, we have the following check for the `ignoreIntrospection` option:\n\n```typescript\n    if (this.config.ignoreIntrospection \u0026\u0026 'name' in node \u0026\u0026 node.name?.value === '__schema') {\n        return 0;\n    }\n```\n\nHowever, the `node` can be one of: `FieldNode`, `FragmentDefinitionNode`, `InlineFragmentNode`, `OperationDefinitionNode`, `FragmentSpreadNode`.\n\nFor example, consider sending the following query:\n\n```graphql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nThis would create an `OperationDefinitionNode` where `node.name.value == 'hello'`\n\nThe proper way to handle this is to check explicitly for the `__schema` field, which corresponds to a `FieldNode`.\n\nThe fix is\n\n```typescript\n    if (\n      this.config.ignoreIntrospection \u0026\u0026\n      'name' in node \u0026\u0026\n      node.name?.value === '__schema' \u0026\u0026\n      node.kind === Kind.FIELD\n    ) {\n      return 0;\n    }\n```\n\nThis ensures that the node is explicitly a `FieldNode`.\n\n### PoC\n\nMax depth: `6`\n\n```graphql\nquery {\n  books {\n    author {\n      books {\n        author {\n          ...__schema\n        }\n      }\n    }\n  }\n}\nfragment __schema on Author {\n  books {\n    title\n  }\n}\n```\n\n### Impact\n\nThis issue affects applications using the GraphQL Armor Depth Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix\n\nThis is fixed in [PR#823](https://github.com/Escape-Technologies/graphql-armor/pull/823)","severity":{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-400"],"published":"2025-08-26T18:42:37Z","modified":"2025-08-26T18:42:38Z","fixes":[{"ecosystem":"npm","package":"@escape.tech/graphql-armor-max-depth","fixed_in":["2.4.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@escape.tech/graphql-armor-max-depth","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.4.1"},{"fixed":"2.4.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@escape.tech/graphql-armor-max-depth","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.4.2"}]}]}],"references":[{"url":"https://github.com/Escape-Technologies/graphql-armor/security/advisories/GHSA-hmfr-rx46-4jx2","tags":["web"]},{"url":"https://github.com/Escape-Technologies/graphql-armor/pull/823","tags":["web"]},{"url":"https://github.com/Escape-Technologies/graphql-armor/commit/1f923bc09f5f053f60b6ba2bd419d4b94cbe1db3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-hmfr-rx46-4jx2"},{"url":"https://github.com/Escape-Technologies/graphql-armor","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-hmfr-rx46-4jx2","title":"GraphQL Armor Max-Depth Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query depth restriction using the `max-depth` property can be bypassed if `ignoreIntrospection` is enabled (which is the default configuration) by naming your query/fragment `__schema`.\n\n### Details\nAt the start of the `countDepth` function, we have the following check for the `ignoreIntrospection` option:\n\n```typescript\n    if (this.config.ignoreIntrospection \u0026\u0026 'name' in node \u0026\u0026 node.name?.value === '__schema') {\n        return 0;\n    }\n```\n\nHowever, the `node` can be one of: `FieldNode`, `FragmentDefinitionNode`, `InlineFragmentNode`, `OperationDefinitionNode`, `FragmentSpreadNode`.\n\nFor example, consider sending the following query:\n\n```graphql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nThis would create an `OperationDefinitionNode` where `node.name.value == 'hello'`\n\nThe proper way to handle this is to check explicitly for the `__schema` field, which corresponds to a `FieldNode`.\n\nThe fix is\n\n```typescript\n    if (\n      this.config.ignoreIntrospection \u0026\u0026\n      'name' in node \u0026\u0026\n      node.name?.value === '__schema' \u0026\u0026\n      node.kind === Kind.FIELD\n    ) {\n      return 0;\n    }\n```\n\nThis ensures that the node is explicitly a `FieldNode`.\n\n### PoC\n\nMax depth: `6`\n\n```graphql\nquery {\n  books {\n    author {\n      books {\n        author {\n          ...__schema\n        }\n      }\n    }\n  }\n}\nfragment __schema on Author {\n  books {\n    title\n  }\n}\n```\n\n### Impact\n\nThis issue affects applications using the GraphQL Armor Depth Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix\n\nThis is fixed in [PR#823](https://github.com/Escape-Technologies/graphql-armor/pull/823)","status":"published","published":"2025-08-26T18:42:37Z","modified":"2025-08-26T18:42:38Z","cvss":[{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"cwes":["CWE-400"],"updated_at":"2026-11-02T14:38:54.795089Z"}],"osv":[{"id":"GHSA-hmfr-rx46-4jx2","title":"GraphQL Armor Max-Depth Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query depth restriction using the `max-depth` property can be bypassed if `ignoreIntrospection` is enabled (which is the default configuration) by naming your query/fragment `__schema`.\n\n### Details\nAt the start of the `countDepth` function, we have the following check for the `ignoreIntrospection` option:\n\n```typescript\n    if (this.config.ignoreIntrospection \u0026\u0026 'name' in node \u0026\u0026 node.name?.value === '__schema') {\n        return 0;\n    }\n```\n\nHowever, the `node` can be one of: `FieldNode`, `FragmentDefinitionNode`, `InlineFragmentNode`, `OperationDefinitionNode`, `FragmentSpreadNode`.\n\nFor example, consider sending the following query:\n\n```graphql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nThis would create an `OperationDefinitionNode` where `node.name.value == 'hello'`\n\nThe proper way to handle this is to check explicitly for the `__schema` field, which corresponds to a `FieldNode`.\n\nThe fix is\n\n```typescript\n    if (\n      this.config.ignoreIntrospection \u0026\u0026\n      'name' in node \u0026\u0026\n      node.name?.value === '__schema' \u0026\u0026\n      node.kind === Kind.FIELD\n    ) {\n      return 0;\n    }\n```\n\nThis ensures that the node is explicitly a `FieldNode`.\n\n### PoC\n\nMax depth: `6`\n\n```graphql\nquery {\n  books {\n    author {\n      books {\n        author {\n          ...__schema\n        }\n      }\n    }\n  }\n}\nfragment __schema on Author {\n  books {\n    title\n  }\n}\n```\n\n### Impact\n\nThis issue affects applications using the GraphQL Armor Depth Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix\n\nThis is fixed in [PR#823](https://github.com/Escape-Technologies/graphql-armor/pull/823)","status":"published","published":"2025-08-26T18:42:37Z","modified":"2025-08-26T18:42:37Z","cvss":[{"version":"3.0","score":5.3,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"cwes":["CWE-400"],"updated_at":"2026-11-02T15:46:49.28217Z"}]}}
