CVE-2023-50730
JSON

7.5high

Grackle has StackOverflowError in GraphQL query processing

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.83% (higher than 58% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-g56x-7j6w-g8r8

Description

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.

Affected

Product or packageVersionsReported by
typelevel grackle< 0.18.0, before 0.18.0CVE List, NVD
org.typelevel:grackle-core_2.13 (Maven)before 0.18.0GitHub Advisory Database
org.typelevel:grackle-core_3 (Maven)before 0.18.0GitHub Advisory Database
org.typelevel:grackle-core_sjs1_2.13 (Maven)before 0.18.0GitHub Advisory Database
org.typelevel:grackle-core_sjs1_3 (Maven)before 0.18.0GitHub Advisory Database
org.typelevel:grackle-core_native0.4_2.13 (Maven)before 0.18.0GitHub Advisory Database
org.typelevel:grackle-core_native0.4_3 (Maven)before 0.18.0GitHub Advisory Database
edu.gemini:gsp-graphql-core_2.13 (Maven)up to 0.14.0GitHub Advisory Database
edu.gemini:gsp-graphql-core_3 (Maven)up to 0.14.0GitHub Advisory Database
edu.gemini:gsp-graphql-core_sjs1_2.13 (Maven)up to 0.14.0GitHub Advisory Database
edu.gemini:gsp-graphql-core_sjs1_3 (Maven)up to 0.14.0GitHub Advisory Database
edu.gemini:gsp-graphql-core_native0.4_2.13 (Maven)up to 0.14.0GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Prior to this fix, the GraphQL query parsing was vulnerable to StackOverflowErrors. 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.

[!CAUTION]
No specific knowledge of an application's GraphQL schema would be required to construct a pathological query.

Patches

The stack overflow issues have been resolved in the v0.18.0 release of Grackle.

Workarounds

Users could interpose a sanitizing layer in between untrusted input and Grackle query processing.

NVD (es)

Grackle es un servidor GraphQL escrito en functional Scala, construido en la pila Typelevel. La especificación GraphQL requiere que los fragmentos de GraphQL no formen ciclos, ni directa ni indirectamente. Antes de la versión 0.18.0 de Grackle, ese requisito no se verificaba y las consultas con fragmentos cíclicos se habrían aceptado para la verificación y compilación de tipos. El intento de compilación de dichos fragmentos daría como resultado que se generara un "StackOverflowError" de JVM. Se necesitaría cierto conocimiento del esquema GraphQL de una aplicación para construir dicha consulta; sin embargo, no se necesitaría ningún conocimiento del rendimiento específico de la aplicación ni de otras características de comportamiento. Grackle usa la librería cats-parse para analizar consultas GraphQL. Antes de la versión 0.18.0, Grackle hacía uso del operador "recursive" de cats-parse. Sin embargo, "recursive" actualmente no es seguro para pilas. "recursive" se usó en tres lugares del analizador: conjuntos de selección anidados, valores de entrada anidados (listas y objetos) y declaraciones de tipos de listas anidadas. En consecuencia, se podrían construir consultas con conjuntos de selección, valores de entrada o tipos de listas profundamente anidados que explotaran esto, provocando que se lanzara una `StackOverflowException` de JVM durante el análisis. Debido a que esto sucede muy temprano en el procesamiento de consultas, no se requeriría ningún conocimiento específico del esquema GraphQL de una aplicación para construir dicha consulta. La posibilidad de que pequeñas consultas provoquen un desbordamiento de la pila es una posible vulnerabilidad de denegación de servicio. Esto afecta potencialmente a todas las aplicaciones que utilizan Grackle y que tienen usuarios que no son de confianza. Ambos problemas de desbordamiento de pila se resolvieron en la versión v0.18.0 de Grackle. Como workaround, los usuarios podrían interponer una capa de sanitización entre las entradas que no son de confianza y el procesamiento de consultas de Grackle.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-50730 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-g56x-7j6w-g8r8 changed 2024-02-16CC-BY-4.0
NVDCVE-2023-50730 changed 2026-06-17Public domain