CVE-2021-29480: Ratpack session Ratpack's Default Client Side Session Vulnerability

MODERATE
Advisory Identifier: GHSA-2cc5-23r7-vc4v
CVSS 4.4
CWE-330 CWE-340
Published
Advisory Summary

CVE-2021-29480 is a MODERATE (CVSS 4.4) ratpack's default client side session vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Ratpack session libraries in the Maven ecosystem. The issue involves ratpack's default client side session signing key is highly predictable. Remediation is available by upgrading affected packages to version 1.9.0.

CVE-2021-29480 at a Glance

CVE Identifier CVE-2021-29480
GHSA Identifier GHSA-2cc5-23r7-vc4v
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-330: Use of Insufficiently Random Values
Affected Product Ratpack session
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 4.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2021-29480

To remediate this vulnerability, upgrade all affected Ratpack session dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.ratpack:ratpack-session fixed: 1.9.0
<dependency>
    <groupId>io.ratpack</groupId>
    <artifactId>ratpack-session</artifactId>
    <version>1.9.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.ratpack

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-29480, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.ratpack

Analyze the terminal output to locate any version of Ratpack session in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.ratpack command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. In Ratpack session, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The client side session module uses the application startup time as the signing key by default. This means that if an attacker can determine this time, and if encryption is not also used (which is recommended, but is not on by default), the session data could be tampered with by someone with the ability to write cookies. The default configuration is unsuitable for production use as an application restart renders all sessions invalid and is not multi-host compatible, but its use is not actively prevented. ### Vulnerability Location https://github.com/ratpack/ratpack/blob/29434f7ac6fd4b36a4495429b70f4c8163100332/ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java#L29 ### Patches As of Ratpack 1.9.0 the default value is a securely randomly generated value, generated at application startup time. ### Workarounds Supply an alternative signing key, as per the documentation's recommendation.

CVE-2021-29480 Affected Ratpack session Versions

1 component(s)
Fixed Versions:
1.9.0
Product / Package Ecosystem Affected Versions Fixed Version
io.ratpack:ratpack-session
Maven
< 1.9.0
1.9.0

References

Frequently Asked Questions

What is CVE-2021-29480?
CVE-2021-29480 is a security vulnerability in Ratpack session involving Ratpack's default client side session signing key is highly predictable under CWE-330: Use of Insufficiently Random Values.
Which Ratpack session versions are affected?
Affected versions include releases prior to 1.9.0 across affected packages: io.ratpack:ratpack-session.
What version fixes CVE-2021-29480?
Upgrading to 1.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ratpack-session affected?
Yes, io.ratpack:ratpack-session is affected in releases prior to 1.9.0. Upgrade your dependency to 1.9.0 or later.
What is the CVSS score of CVE-2021-29480?
CVE-2021-29480 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2021-29480?
CVE-2021-29480 is classified under CWE-330: Use of Insufficiently Random Values (The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.).
How can I check Maven dependencies for CVE-2021-29480?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.ratpack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2cc5-23r7-vc4v",
  "modified" : "2022-08-11T00:17:56Z",
  "published" : "2021-07-01T17:02:26Z",
  "aliases" : [ "CVE-2021-29480" ],
  "summary" : "Ratpack's default client side session signing key is highly predictable",
  "details" : "### Impact\n\nThe client side session module uses the application startup time as the signing key by default. This means that if an attacker can determine this time, and if encryption is not also used (which is recommended, but is not on by default), the session data could be tampered with by someone with the ability to write cookies. \n\nThe default configuration is unsuitable for production use as an application restart renders all sessions invalid and is not multi-host compatible, but its use is not actively prevented.\n\n### Vulnerability Location\n\nhttps://github.com/ratpack/ratpack/blob/29434f7ac6fd4b36a4495429b70f4c8163100332/ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java#L29\n\n### Patches\n\nAs of Ratpack 1.9.0 the default value is a securely randomly generated value, generated at application startup time. \n\n### Workarounds\n\nSupply an alternative signing key, as per the documentation's recommendation.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.ratpack:ratpack-session"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ratpack/ratpack/security/advisories/GHSA-2cc5-23r7-vc4v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29480"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ratpack/ratpack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ratpack/ratpack/blob/29434f7ac6fd4b36a4495429b70f4c8163100332/ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java#L29"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-330", "CWE-340" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-30T17:49:41Z",
    "nvd_published_at" : "2021-06-29T19:15:00Z"
  }
}