{"id":"GHSA-733v-p3h5-qpq7","aliases":[],"status":"published","title":"GraphQL Armor Cost-Limit Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query cost restriction using the `cost-limit` 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 `computeComplexity` function, we have the following check for `ignoreIntrospection` option:\n\n```ts\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 `FieldNode | FragmentDefinitionNode | InlineFragmentNode | OperationDefinitionNode | FragmentSpreadNode`\n\nSo, for example, sending the following query\n\n```gql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nwould create an `OperationDefinitionNode` with `node.name.value == 'hello'`\n\nThe proper way to handle this would be to check for the `__schema` field, which would create a `FieldNode`.\n\nThe fix is\n\n```ts\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\nto assert that the node must be a `FieldNode`\n\n### PoC\n```gql\nquery  {\n  ...__schema\n}\n\nfragment __schema on Query {\n  books {\n    title\n    author\n  }\n}\n```\n\n```gql\nquery __schema {\n  books {\n    title\n    author\n  }\n}\n```\n\n### Impact\nApplications using GraphQL Armor Cost Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix:\nFixed on [772](https://github.com/Escape-Technologies/graphql-armor/pull/772). A quick patch would be to set `ignoreIntrospection` to false.","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","CWE-770"],"published":"2025-04-25T15:14:36Z","modified":"2025-04-29T16:45:59Z","fixes":[{"ecosystem":"npm","package":"@escape.tech/graphql-armor-cost-limit","fixed_in":["2.4.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@escape.tech/graphql-armor-cost-limit","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.4.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@escape.tech/graphql-armor-cost-limit","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.4.2"}]}]}],"references":[{"url":"https://github.com/Escape-Technologies/graphql-armor/security/advisories/GHSA-733v-p3h5-qpq7","tags":["web"]},{"url":"https://github.com/Escape-Technologies/graphql-armor/pull/772","tags":["web"]},{"url":"https://github.com/Escape-Technologies/graphql-armor/commit/5a329541cf32a359ee1f69748738f91231b26eba","tags":["web"]},{"url":"https://github.com/advisories/GHSA-733v-p3h5-qpq7"},{"url":"https://github.com/Escape-Technologies/graphql-armor","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-733v-p3h5-qpq7","title":"GraphQL Armor Cost-Limit Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query cost restriction using the `cost-limit` 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 `computeComplexity` function, we have the following check for `ignoreIntrospection` option:\n\n```ts\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 `FieldNode | FragmentDefinitionNode | InlineFragmentNode | OperationDefinitionNode | FragmentSpreadNode`\n\nSo, for example, sending the following query\n\n```gql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nwould create an `OperationDefinitionNode` with `node.name.value == 'hello'`\n\nThe proper way to handle this would be to check for the `__schema` field, which would create a `FieldNode`.\n\nThe fix is\n\n```ts\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\nto assert that the node must be a `FieldNode`\n\n### PoC\n```gql\nquery  {\n  ...__schema\n}\n\nfragment __schema on Query {\n  books {\n    title\n    author\n  }\n}\n```\n\n```gql\nquery __schema {\n  books {\n    title\n    author\n  }\n}\n```\n\n### Impact\nApplications using GraphQL Armor Cost Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix:\nFixed on [772](https://github.com/Escape-Technologies/graphql-armor/pull/772). A quick patch would be to set `ignoreIntrospection` to false.","status":"published","published":"2025-04-25T15:14:36Z","modified":"2025-04-29T16:45:59Z","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","CWE-770"],"updated_at":"2026-11-02T14:38:41.402125Z"}],"osv":[{"id":"GHSA-733v-p3h5-qpq7","title":"GraphQL Armor Cost-Limit Plugin Bypass via Introspection Query Obfuscation","description":"### Summary\nA query cost restriction using the `cost-limit` 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 `computeComplexity` function, we have the following check for `ignoreIntrospection` option:\n\n```ts\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 `FieldNode | FragmentDefinitionNode | InlineFragmentNode | OperationDefinitionNode | FragmentSpreadNode`\n\nSo, for example, sending the following query\n\n```gql\nquery hello {\n  books {\n    title\n  }\n}\n```\n\nwould create an `OperationDefinitionNode` with `node.name.value == 'hello'`\n\nThe proper way to handle this would be to check for the `__schema` field, which would create a `FieldNode`.\n\nThe fix is\n\n```ts\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\nto assert that the node must be a `FieldNode`\n\n### PoC\n```gql\nquery  {\n  ...__schema\n}\n\nfragment __schema on Query {\n  books {\n    title\n    author\n  }\n}\n```\n\n```gql\nquery __schema {\n  books {\n    title\n    author\n  }\n}\n```\n\n### Impact\nApplications using GraphQL Armor Cost Limit plugin with `ignoreIntrospection` enabled.\n\n### Fix:\nFixed on [772](https://github.com/Escape-Technologies/graphql-armor/pull/772). A quick patch would be to set `ignoreIntrospection` to false.","status":"published","published":"2025-04-25T15:14:36Z","modified":"2025-04-29T16:45:56Z","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","CWE-770"],"updated_at":"2026-11-02T15:46:40.308826Z"}]}}
