# GHSA-3h96-34p3-xm76: GraphQL-Ruby's Ruby lexer does not count comment tokens for the purposes of max_query_string_tokens

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-05-05T21:51:15.000Z
- Modified: 2026-05-05T22:09:47.011Z
- Weaknesses: CWE-770

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- graphql (RubyGems): from 2.6.0 before 2.6.1; from 2.5.0 before 2.5.26; from 2.4.0 before 2.4.18; from 2.3.1 before 2.3.23

## References

- <https://github.com/rmosolgo/graphql-ruby/security/advisories/GHSA-3h96-34p3-xm76> (web)
- <https://github.com/rmosolgo/graphql-ruby> (package)

## Sources

- GitHub Advisory Database: [GHSA-3h96-34p3-xm76](https://github.com/advisories/GHSA-3h96-34p3-xm76), CC-BY-4.0, modified 2026-05-05

---

Page: https://cve.day/GHSA-3h96-34p3-xm76 · Whole record: https://cve.day/GHSA-3h96-34p3-xm76.json · Rebuilt by cve.day 2026-11-25T22:56:41.108Z
