CVE-2021-29481: Ratpack session Unencrypted Storage Of Client Side Vulnerability
MODERATECVE-2021-29481 is a MODERATE (CVSS 6.5) unencrypted storage of client side vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Ratpack session libraries in the Maven ecosystem. The issue involves unencrypted storage of client side sessions. Remediation is available by upgrading affected packages to version 1.9.0.
CVE-2021-29481 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-29481
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.
<dependency>
<groupId>io.ratpack</groupId>
<artifactId>ratpack-session</artifactId>
<version>1.9.0</version>
</dependency>
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-29481, 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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. 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
CVE-2021-29481 Affected Ratpack session Versions
1 component(s)| 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-29481?
Which Ratpack session versions are affected?
What version fixes CVE-2021-29481?
Is ratpack-session affected?
What is the CVSS score of CVE-2021-29481?
What CWE is associated with CVE-2021-29481?
How can I check Maven dependencies for CVE-2021-29481?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-phj8-4cq3-794g",
"modified" : "2021-09-01T19:32:49Z",
"published" : "2021-07-01T17:02:13Z",
"aliases" : [ "CVE-2021-29481" ],
"summary" : "Unencrypted storage of client side sessions",
"details" : "### Impact\n\nThe default configuration of client side sessions results in unencrypted, but signed, data being set as cookie values. This means that if something sensitive goes into the session, it could be read by something with access to the cookies.\n\nNote: the documentation does point this out and encourage users to add an encryption key, but it is not mandatory.\n\nFor this to be a vulnerability, some kind of sensitive data would need to be stored in the session and the session cookie would have to leak. For example, the cookies are not configured with httpOnly and an adjacent XSS vulnerability within the site allowed capture of the cookies.\n\nThe proposed change is to change the default behaviour to use a randomly generated encryption key. This would mean that sessions do not survive app restarts, but this is already the behaviour given the random signing key.\n\n### Patches\n\nAs of version 1.9.0, a securely randomly generated signing key is used.\n\n### Workarounds\n\nSupply an encryption key, as per the documentation recommendation.\n\n### References\n\n- https://github.com/ratpack/ratpack/pull/1590\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/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-phj8-4cq3-794g"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29481"
}, {
"type" : "WEB",
"url" : "https://github.com/ratpack/ratpack/pull/1590"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ratpack/ratpack"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-312" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-30T17:48:41Z",
"nvd_published_at" : "2021-06-29T19:15:00Z"
}
}