9.9critical
Remote Code Execution Vulnerability in Session Storage
- Severity
- 9.9critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 2.03% (higher than 82% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hc33-32vw-rpp9
Description
Ratpack is a toolkit for creating web applications. In versions prior to 1.9.0, a malicious attacker can achieve Remote Code Execution (RCE) via a maliciously crafted Java deserialization gadget chain leveraged against the Ratpack session store. If one's application does not use Ratpack's session mechanism, it is not vulnerable. Ratpack 1.9.0 introduces a strict allow-list mechanism that mitigates this vulnerability when used. Two possible workarounds exist. The simplest mitigation for users of earlier versions is to reduce the likelihood of attackers being able to write to the session data store. Alternatively or additionally, the allow-list mechanism could be manually back ported by providing an alternative implementation of `SessionSerializer` that uses an allow-list.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ratpack ratpack | < 1.9.0 | CVE List |
| io.ratpack:ratpack-core (Maven) | before 1.9.0 | GitHub Advisory Database |
| ratpack_project ratpack | before 1.9.0 | NVD |
All scores
| GitHub_M | 9.9critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 9.9critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 6.5medium CVSS:2.0 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
Classification
What each source says
CVE List
Ratpack is a toolkit for creating web applications. In versions prior to 1.9.0, a malicious attacker can achieve Remote Code Execution (RCE) via a maliciously crafted Java deserialization gadget chain leveraged against the Ratpack session store. If one's application does not use Ratpack's session mechanism, it is not vulnerable. Ratpack 1.9.0 introduces a strict allow-list mechanism that mitigates this vulnerability when used. Two possible workarounds exist. The simplest mitigation for users of earlier versions is to reduce the likelihood of attackers being able to write to the session data store. Alternatively or additionally, the allow-list mechanism could be manually back ported by providing an alternative implementation of `SessionSerializer` that uses an allow-list.
GitHub Advisory Database
Impact
A malicious attacker can achieve Remote Code Execution (RCE) via a maliciously crafted Java deserialization gadget chain leveraged against the Ratpack session store.
If your application does not use Ratpack's session mechanism, it is not vulnerable.
Details
Attackers with the ability to write to session data, can potentially craft payloads that deserialize unsafe objects, leading to the ability to remotely execute arbitrary code. This is known as an “insecure deserialization” vulnerability, or “gadget vulnerability”.
Ratpack allows session data to be stored server side in an external system such as a relational database, or client side via user cookies. When using server side storage, the attacker would need to obtain the ability to write to the session data store. When using client side storage, the attacker would need to obtain the secrets used to encrypt and/or sign the session data stored in user cookies.
Ratpack's session mechanism allows storing serialized objects, of arbitrary types. The type must be specified when writing the data and when reading, with data only deserialized when there is an exact type match. However, in the process of deserializing an object of a known/trusted/deserialization-safe type, it may attempt to deserialize unsafe types.
By default Ratpack uses Java's built-in serialization mechanism, though other serialization providers can be used. The exact types of payloads required to enable an exploit depend on the exact serialization mechanism used.
To mitigate this vulnerability, Ratpack now employs a “strict allow-list” when deserializing (and serializing) objects to session data. All concrete types of objects serialized must be explicitly declared as safe. Some standard well known JDK types are registered by default.
Serialization is provided by implementations of SessionSerializer.
Its existing methods have been deprecated, and replaced with a new methods that accept a SessionTypeFilter that can be used to assert whether a type is allowed when serializing and deserializing.
The default serializer implementation has been updated to use this mechanism. Any proprietary implementations should also be updated to consult the type filter before serializing or deserializing data. Warnings will be logged any time an implementation that does not implement the new methods is used.
Upon upgrading to Ratpack 1.9, users of the built-in serialization mechanism will need to change their application to declare all types currently being serialized as being safe. This can be done using the new SessionModule.allowTypes() method. Please see its documentation for details...))
Patches
Ratpack 1.9.0 introduces a strict allow-list mechanism that mitigates this vulnerability when used.
Workarounds
The simplest mitigation for users of earlier versions is to reduce the likelihood of attackers being able to write to the session data store.
Alternatively or additionally, the allow-list mechanism could be manually back ported by providing an alternative implementation of SessionSerializer that uses an allow-list.
References
NVD (es)
Ratpack es un kit de herramientas para crear aplicaciones web. En las versiones anteriores a 1.9.0, un atacante malicioso puede lograr una Ejecución de Código Remota (RCE) por medio de una cadena de gadgets de deserialización de Java maliciosamente diseñada y aprovechada contra el almacén de sesiones de Ratpack. Si una aplicación no usa el mecanismo de sesión de Ratpack, no es vulnerable. Ratpack versión 1.9.0 introduce un mecanismo de lista de permisos estrictos que mitiga esta vulnerabilidad cuando se usa. Se presentan dos posibles soluciones. La mitigación más sencilla para los usuarios de versiones anteriores es reducir la probabilidad de que los atacantes puedan escribir en el almacén de datos de la sesión. Alternativa o adicionalmente, el mecanismo de lista permitida podría ser portado manualmente al proveer una implementación alternativa de "SessionSerializer" que use una lista permitida
References
| https://github.com/ratpack/ratpack/security/advisories/GHSA-hc33-32vw-rpp9 | third-party-advisory, web | |
| https://mvnrepository.com/artifact/io.ratpack/ratpack-core | release-notes, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29485 | advisory | |
| https://github.com/ratpack/ratpack | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29485 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hc33-32vw-rpp9 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29485 changed 2026-06-17 | Public domain |