CVE-2021-29479: Ratpack core Cached Redirect Poisoning Vulnerability
HIGHCVE-2021-29479 is a HIGH (CVSS 7.0) cached redirect poisoning vulnerability (CWE-807: Reliance on Untrusted Inputs in a Security Decision) affecting Ratpack core libraries in the Maven ecosystem. The issue involves cached redirect poisoning via x-forwarded-host header. Remediation is available by upgrading affected packages to version 1.9.0.
CVE-2021-29479 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L).
How to Fix CVE-2021-29479
To remediate this vulnerability, upgrade all affected Ratpack core 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-core</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-29479, 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 core 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-807: Reliance on Untrusted Inputs in a Security Decision, where the product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism. In Ratpack core, 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-29479 Affected Ratpack core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.ratpack:ratpack-core
|
Maven |
< 1.9.0
|
1.9.0
|
References
Frequently Asked Questions
What is CVE-2021-29479?
Which Ratpack core versions are affected?
What version fixes CVE-2021-29479?
Is ratpack-core affected?
What is the CVSS score of CVE-2021-29479?
What CWE is associated with CVE-2021-29479?
How can I check Maven dependencies for CVE-2021-29479?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w6rq-6h34-vh7q",
"modified" : "2021-09-01T19:32:52Z",
"published" : "2021-07-01T17:02:38Z",
"aliases" : [ "CVE-2021-29479" ],
"summary" : "Cached redirect poisoning via X-Forwarded-Host header",
"details" : "A user supplied `X-Forwarded-Host` header can be used to perform cache poisoning of a cache fronting a Ratpack server if the cache key does not include the `X-Forwarded-Host` header as a cache key.\n\nUsers are only vulnerable if they do not configure a custom `PublicAddress` instance. A custom `PublicAddress` can be specified by using [ServerConfigBuilder::publicAddress](https://ratpack.io/manual/current/api/ratpack/server/ServerConfigBuilder.html#publicAddress-java.net.URI-). For versions prior to 1.9.0, by default, Ratpack utilizes an inferring version of `PublicAddress` which is vulnerable.\n\n### Impact\n\nThis can be used to perform redirect cache poisoning where an attacker can force a cached redirect to redirect to their site instead of the intended redirect location.\n\n### Patches\n\nAs of Ratpack 1.9.0, two changes have been made that mitigate this vulnerability:\n\n1. The default PublicAddress implementation no longer infers the address from the request context, instead relying on the configured bind host/port\n2. Relative redirects issued by the application are no longer absolutized; they are passed through as-is\n\n### Workarounds\n\nIn production, ensure that [ServerConfigBuilder::publicAddress](https://ratpack.io/manual/current/api/ratpack/server/ServerConfigBuilder.html#publicAddress-java.net.URI-) correctly configures the server.\n\n### References\n - https://portswigger.net/web-security/web-cache-poisoning",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.ratpack:ratpack-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ratpack/ratpack/security/advisories/GHSA-w6rq-6h34-vh7q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29479"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ratpack/ratpack"
}, {
"type" : "WEB",
"url" : "https://portswigger.net/web-security/web-cache-poisoning"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-807" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-30T17:50:31Z",
"nvd_published_at" : "2021-06-29T15:15:00Z"
}
}