CWE
400 770
Advisory Published
Updated

GHSA-733v-p3h5-qpq7

First published: Fri Apr 25 2025(Updated: )

### 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: ```ts 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 ```gql 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 ```ts 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 ```gql query { ...__schema } fragment __schema on Query { books { title author } } ``` ```gql query __schema { books { title author } } ``` ### Impact Applications using GraphQL Armor Cost Limit plugin with `ignoreIntrospection` enabled. ### Fix: Fixed on [772](https://github.com/Escape-Technologies/graphql-armor/pull/772). A quick patch would be to set `ignoreIntrospection` to false.

Affected SoftwareAffected VersionHow to fix
npm/@escape.tech/graphql-armor-cost-limit<=2.4.0

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of GHSA-733v-p3h5-qpq7?

    The severity of GHSA-733v-p3h5-qpq7 is considered medium due to the ability to bypass cost limits.

  • How do I fix GHSA-733v-p3h5-qpq7?

    To fix GHSA-733v-p3h5-qpq7, ensure that the `ignoreIntrospection` option is set to false.

  • What is the main issue in GHSA-733v-p3h5-qpq7?

    The main issue in GHSA-733v-p3h5-qpq7 is the ability to bypass query cost limits when using introspection queries.

  • Which software is affected by GHSA-733v-p3h5-qpq7?

    The software affected by GHSA-733v-p3h5-qpq7 is the @escape.tech/graphql-armor-cost-limit package up to version 2.4.0.

  • Is GHSA-733v-p3h5-qpq7 linked to any specific GraphQL settings?

    Yes, GHSA-733v-p3h5-qpq7 is linked to the configuration setting of `ignoreIntrospection` in GraphQL.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203