Summary
io.ratpack:ratpack-core vulnerable to Improper Neutralization of Special Elements in Output ('Injection')
CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting')
Versions of Ratpack 0.9.1 through and including 1.7.4 are vulnerable to HTTP Response Splitting,
if untrusted and unsanitized data is used to populate the headers of an HTTP response.
An attacker can utilize this vulnerability to have the server issue any HTTP response they specify.
If your application uses arbitrary user input as the value of a response header it is vulnerable.
If your application does not use arbitrary values as response header values, it is not vulnerable.
Previously, Ratpack did not validate response header values.
Now, adding a header value that contains the header value termination characters (CRLF) produces a runtime exception.
Since there is no mechanism for escaping or encoding the termination characters in a String, a runtime exception is necessary.
As potentially dangerous values now cause runtime exceptions, it is a good idea to continue to validate and sanitize any user-supplied values being used as response headers.
We would like to thank Jonathan Leitschuh for reporting this vulnerability.
Vulnerable Example
The following example server uses a query parameter value as a response header, without validating or sanitizing it.
RatpackServer startedServer = RatpackServer.start(server -> {
server.handlers(chain -> chain.all(ctx -> {
// User supplied query parameter
String header = ctx.getRequest().getQueryParams().get("header");
// User supplied data used to populate a header value.
ctx.header("the-header", header)
.render("OK!");
}));
});
Sending a request to the server with the following value for the header query param would allow the execution of arbitrary Javascript.
Content-Type: text/html
X-XSS-Protection: 0
<script>alert(document.domain)</script>
Root Cause
The root cause was due to using the netty DefaultHttpHeaders object with verification disabled.
This vulnerability is now more clearly documented in the Netty documentation: https://github.com/netty/netty/pull/9646
Workarounds
The workaround for this vulnerability is to either not use arbitrary input as response header values or validate such values before being used to ensure they don't contain a carriage return and/or line feed characters.
References
- CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting')
- Fix commit: https://github.com/ratpack/ratpack/commit/efb910d38a96494256f36675ef0e5061097dd77d
For more information
If you have any questions or comments about this advisory:
- Open an issue in ratpack/ratpack
- Ask in our Slack channel
Impact
- Cross-User Defacement
- Cache Poisoning
- Cross-Site Scripting
- Page Hijacking
CVE-2019-17513 has a CVSS score of 7.5 (High). The vector is network-reachable, no 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.7.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
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
This vulnerability has been patched in Ratpack version 1.7.5.
Frequently Asked Questions
- What is CVE-2019-17513? CVE-2019-17513 is a high-severity security vulnerability in io.ratpack:ratpack-core (maven), affecting versions < 1.7.5. It is fixed in 1.7.5.
- How severe is CVE-2019-17513? CVE-2019-17513 has a CVSS score of 7.5 (High). 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.
- Which versions of io.ratpack:ratpack-core are affected by CVE-2019-17513? io.ratpack:ratpack-core (maven) versions < 1.7.5 is affected.
- Is there a fix for CVE-2019-17513? Yes. CVE-2019-17513 is fixed in 1.7.5. Upgrade to this version or later.
- Is CVE-2019-17513 exploitable, and should I be worried? Whether CVE-2019-17513 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
- What actually determines whether CVE-2019-17513 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.
- How do I fix CVE-2019-17513? Upgrade
io.ratpack:ratpack-coreto 1.7.5 or later.