GraphQL Armor Cost-Limit Plugin Bypass via Introspection Query Obfuscation
Summary
A 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.
Details
At the start of the computeComplexity function, we have the following check for ignoreIntrospection option:
if (this.config.ignoreIntrospection && 'name' in node && node.name?.value === '__schema') {
return 0;
}
However, the node can be FieldNode | FragmentDefinitionNode | InlineFragmentNode | OperationDefinitionNode | FragmentSpreadNode
So, for example, sending the following query
query hello {
books {
title
}
}
would create an OperationDefinitionNode with node.name.value == 'hello'
The proper way to handle this would be to check for the __schema field, which would create a FieldNode.
The fix is
if (
this.config.ignoreIntrospection &&
'name' in node &&
node.name?.value === '__schema' &&
node.kind === Kind.FIELD
) {
return 0;
}
to assert that the node must be a FieldNode
PoC
query {
...__schema
}
fragment __schema on Query {
books {
title
author
}
}
query __schema {
books {
title
author
}
}
Impact
Applications using GraphQL Armor Cost Limit plugin with ignoreIntrospection enabled.
Fix:
Fixed on 772. A quick patch would be to set ignoreIntrospection to false.
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | @escape.tech/graphql-armor-cost-limit | < 2.4.2 | 2.4.2 |
Verweise
- https://github.com/Escape-Technologies/graphql-armor/security/advisories/GHSA-733v-p3h5-qpq7
- https://github.com/Escape-Technologies/graphql-armor/pull/772
- https://github.com/Escape-Technologies/graphql-armor/commit/5a329541cf32a359ee1f69748738f91231b26eba
- https://github.com/Escape-Technologies/graphql-armor
- CVSS-Vektor
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L- Schwäche (CWE)
CWE-400, CWE-770- Plattform
- npm
- Paket
@escape.tech/graphql-armor-cost-limit- Veröffentlicht
- 25.04.2025
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-733v-p3h5-qpq7 - CC BY 4.0
Schwachstellenhistorie: @escape.tech/graphql-armor-cost-limit
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.