CVE-2021-29485

CVE-2021-29485 is a critical-severity insecure deserialization vulnerability in io.ratpack:ratpack-core (maven), affecting versions < 1.9.0. It is fixed in 1.9.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Remote Code Execution Vulnerability in Session Storage

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

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

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.

Untrusted serialized data is processed by a deserializer that can instantiate arbitrary objects or execute code as a side effect. Typical impact: arbitrary code execution or logic abuse.

CVE-2021-29485 has a CVSS score of 9.9 (Critical). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.9.0); upgrading removes the vulnerable code path.

Affected versions

io.ratpack:ratpack-core (< 1.9.0)

Security releases

io.ratpack:ratpack-core → 1.9.0 (maven)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Ratpack 1.9.0 introduces a strict allow-list mechanism that mitigates this vulnerability when used.

Frequently Asked Questions

  1. What is CVE-2021-29485? CVE-2021-29485 is a critical-severity insecure deserialization vulnerability in io.ratpack:ratpack-core (maven), affecting versions < 1.9.0. It is fixed in 1.9.0. Untrusted serialized data is processed by a deserializer that can instantiate arbitrary objects or execute code as a side effect.
  2. How severe is CVE-2021-29485? CVE-2021-29485 has a CVSS score of 9.9 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of io.ratpack:ratpack-core are affected by CVE-2021-29485? io.ratpack:ratpack-core (maven) versions < 1.9.0 is affected.
  4. Is there a fix for CVE-2021-29485? Yes. CVE-2021-29485 is fixed in 1.9.0. Upgrade to this version or later.
  5. Is CVE-2021-29485 exploitable, and should I be worried? Whether CVE-2021-29485 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2021-29485 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2021-29485? Upgrade io.ratpack:ratpack-core to 1.9.0 or later.

Other vulnerabilities in io.ratpack:ratpack-core

Stop the waste.
Protect your environment with Kodem.