CVE-2023-50730

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:typelevel:grackle:*:*:*:*:*:*:*:*

History

08 Jan 2024, 12:57

Type Values Removed Values Added
References () https://github.com/typelevel/grackle/commit/56e244b91659cf385df590fc6c46695b6f36cbfd - () https://github.com/typelevel/grackle/commit/56e244b91659cf385df590fc6c46695b6f36cbfd - Patch
References () https://github.com/typelevel/grackle/releases/tag/v0.18.0 - () https://github.com/typelevel/grackle/releases/tag/v0.18.0 - Release Notes
References () https://github.com/typelevel/grackle/security/advisories/GHSA-g56x-7j6w-g8r8 - () https://github.com/typelevel/grackle/security/advisories/GHSA-g56x-7j6w-g8r8 - Vendor Advisory
Summary
  • (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.
CPE cpe:2.3:a:typelevel:grackle:*:*:*:*:*:*:*:*
First Time Typelevel
Typelevel grackle

22 Dec 2023, 21:15

Type Values Removed Values Added
New CVE

Information

Published : 2023-12-22 21:15

Updated : 2024-01-08 12:57


NVD link : CVE-2023-50730

Mitre link : CVE-2023-50730

CVE.ORG link : CVE-2023-50730


JSON object : View

Products Affected

typelevel

  • grackle
CWE
CWE-400

Uncontrolled Resource Consumption

CWE-770

Allocation of Resources Without Limits or Throttling