CVE-2023-50730Grackle has StackOverflowError in GraphQL query processing
Grackle is a GraphQL server written in functional Scala, built on the Typelevel stack. The GraphQL specification requires that GraphQL fragments must not form cycles, either directly or indirectly. Prior to Grackle version 0.18.0, that requirement wasn't checked, and queries with cyclic fragments would have been accepted for type checking and compilation. The attempted compilation of such fragments would result in a JVM `StackOverflowError` being thrown. Some knowledge of an applications GraphQL schema would be required to construct such a query, however no knowledge of any application-specific performance or other behavioural characteristics would be needed. Grackle uses the cats-parse library for parsing GraphQL queries. Prior to version 0.18.0, Grackle made use of the cats-parse `recursive` operator. However, `recursive` is not currently stack safe. `recursive` was used in three places in the parser: nested selection sets, nested input values (lists and objects), and nested list type declarations. Consequently, queries with deeply nested selection sets, input values or list types could be constructed which exploited this, causing a JVM `StackOverflowException` to be thrown during parsing. Because this happens very early in query processing, no specific knowledge of an applications GraphQL schema would be required to construct such a query. The possibility of small queries resulting in stack overflow is a potential denial of service vulnerability. This potentially affects all applications using Grackle which have untrusted users. Both stack overflow issues have been resolved in the v0.18.0 release of Grackle. As a workaround, users could interpose a sanitizing layer in between untrusted input and Grackle query processing.
What to do
Fixed builds are available from Maven: see the table below for the fixed version per release.
Maven has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Maven library | edu.gemini:gsp-graphql-core_2.13 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | edu.gemini:gsp-graphql-core_3 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | edu.gemini:gsp-graphql-core_native0.4_2.13 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | edu.gemini:gsp-graphql-core_native0.4_3 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | edu.gemini:gsp-graphql-core_sjs1_2.13 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | edu.gemini:gsp-graphql-core_sjs1_3 | Fix pending | GHSA-g56x-7j6w-g8r8 | |
| Maven library | org.typelevel:grackle-core_2.13 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
| Maven library | org.typelevel:grackle-core_3 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
| Maven library | org.typelevel:grackle-core_native0.4_2.13 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
| Maven library | org.typelevel:grackle-core_native0.4_3 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
| Maven library | org.typelevel:grackle-core_sjs1_2.13 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
| Maven library | org.typelevel:grackle-core_sjs1_3 | Fixed | 0.18.0 | GHSA-g56x-7j6w-g8r8 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- typelevel grackle: affected: < 0.18.0
References
- https://github.com/typelevel/grackle/security/advisories/GHSA-g56x-7j6w-g8r8
- https://github.com/typelevel/grackle/commit/56e244b91659cf385df590fc6c46695b6f36cbfd
- https://github.com/typelevel/grackle/releases/tag/v0.18.0
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.