CVE-2019-10770
Default development error handler in Ratpack is vulnerable to HTML content injection (XSS)
Description
Versions of Ratpack from 0.9.10 through 1.7.5 are vulnerable to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (aka. XSS) in the development error handler. An attacker can utilize this to perform XSS when an exception message contains untrusted data.
As a simplistic example:
RatpackServer startedServer = RatpackServer.start(server -> {
server.handlers(chain -> chain.all(ctx -> {
// User supplied query parameter
String message = ctx.getRequest().getQueryParams().get("message");
// User supplied data appended to the message in an exception
throw new RuntimeException("An error occurred: " + message);
}));
});
Impact
- Cross-Site Scripting
Patches
This vulnerability has been patched in Ratpack version 1.7.6.
Workarounds
If you are unable to update your version of Ratpack, we recommend the following workarounds and mitigations.
- Ensure that development mode is disabled in production.
- Don't use real customer data (ie. untrusted user input) in development.
References
For more information
If you have any questions or comments about this advisory:
- Open an issue in ratpack/ratpack
- Ask in our Slack channel
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.ratpack » ratpack-core | < 1.7.6 | 1.7.6 |
Blast radius
51% of the dependent artifacts (87) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 937 |
| 2 hops | 1,609 |
| 3 hops | 549 |
| 4 hops | 295 |
| 5 hops | 36 |
Most used dependents
- io.ratpack » ratpack-guice53 usages
- io.ratpack » ratpack-test17 usages
- com.github.jruby-gradle » jruby-gradle-plugin16 usages
- io.ratpack » ratpack-groovy15 usages
- io.ratpack » ratpack-groovy-test15 usages
- io.ratpack » ratpack-rx11 usages
- org.asciidoctor » asciidoctor-gradle-jvm-slides10 usages
- org.asciidoctor » asciidoctor-gradle-jvm-gems9 usages
- org.asciidoctor » asciidoctor5-jvm-core-plugin9 usages
- com.onresolve.jira.groovy » groovyrunner7 usages
- com.github.mstream-trader » commons-config7 usages
- com.github.mstream-trader » commons-test6 usages
- io.ratpack » ratpack-session5 usages
- me.drmaas » ratpack-kotlin-test5 usages
- com.onresolve.confluence.groovy » groovyrunner5 usages
Computed from the dependency graph of build 20261128.0605 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2019-10770 | nvd.nist.gov |
| Web | ratpack/ratpack advisory GHSA-r2wf-q3x4-hrv9 | github.com |
| Web | ratpack/ratpack commit a3cbb13 | github.com |
| Web | vuln/SNYK-JAVA-IORATPACK-534882 | snyk.io |
