GHSA-3h96-34p3-xm76: GraphQL-Ruby's Ruby lexer does not count comment tokens for the purposes of max_query_string_tokens
GraphQL-Ruby's maxquerystringtokens configuration didn't count comment tokens against the limit, allowing strings to be processed even after the configured maximum had actually been reached. In patched versions, the Ruby lexer does count these tokens. GraphQL-CParser is not affected by this problem. maxquerystringtokens was introduced in v2.3.1. Each 2.x version has received a new patch release for including a fix.
Published May 5, 2026
Affected packages
graphql
- Ecosystem
- RubyGems
- Affected
- = 2.6.0
- Fixed in
- 2.6.1
- Check
bundle info graphql
graphql
- Ecosystem
- RubyGems
- Affected
- >= 2.5.0, < 2.5.26
- Fixed in
- 2.5.26
- Check
bundle info graphql
graphql
- Ecosystem
- RubyGems
- Affected
- >= 2.4.0, < 2.4.18
- Fixed in
- 2.4.18
- Check
bundle info graphql
graphql
- Ecosystem
- RubyGems
- Affected
- >= 2.3.1, < 2.3.23
- Fixed in
- 2.3.23
- Check
bundle info graphql
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
GraphQL-Ruby's max_query_string_tokens configuration didn't count comment tokens against the limit, allowing strings to be processed even after the configured maximum had actually been reached.
In patched versions, the Ruby lexer does count these tokens.
GraphQL-CParser is not affected by this problem.
max_query_string_tokens was introduced in v2.3.1. Each 2.x version has received a new patch release for including a fix.
Credited to d0cs1s-bzhunt, rmosolgo.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
