CVE-2021-29481 is a high-severity (CVSS 7.5) CWE-312 vulnerability in io.ratpack:ratpack-session. A fix is available for io.ratpack:ratpack-session — see the affected versions and patch details below.
Unencrypted storage of client side sessions
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
io.ratpack:ratpack-sessionReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Impact
The 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.
Note: the documentation does point this out and encourage users to add an encryption key, but it is not mandatory.
For 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.
The 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.
Patches
As of version 1.9.0, a securely randomly generated signing key is used.
Workarounds
Supply an encryption key, as per the documentation recommendation.
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | io.ratpack:ratpack-session | all versions | 1.9.0io.ratpack:ratpack-session:1.9.0 |
Affected Products
ratpackratpack_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for io.ratpack:ratpack-session, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update io.ratpack:ratpack-session to 1.9.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-29481 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2021-29481 in your dependencies?
Find it across Maven, including transitive dependencies.