CVE-2019-10770: Ratpack core Cross-Site Scripting Vulnerability
MODERATECVE-2019-10770 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Ratpack core libraries in the Maven ecosystem. The issue involves default development error handler in ratpack is vulnerable to html content injection (xss). Remediation is available by upgrading affected packages to version 1.7.6.
CVE-2019-10770 at a Glance
Security Impact
CVSS: 6.1
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:C/C:L/I:L/A:N).
How to Fix CVE-2019-10770
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.7.6</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-2019-10770, 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.7.6), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-2019-10770 Affected Ratpack core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.ratpack:ratpack-core
|
Maven |
< 1.7.6
|
1.7.6
|
References
Frequently Asked Questions
What is CVE-2019-10770?
Which Ratpack core versions are affected?
What version fixes CVE-2019-10770?
Is ratpack-core affected?
What is the CVSS score of CVE-2019-10770?
What CWE is associated with CVE-2019-10770?
How can I check Maven dependencies for CVE-2019-10770?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r2wf-q3x4-hrv9",
"modified" : "2021-08-19T16:44:56Z",
"published" : "2020-01-27T19:28:20Z",
"aliases" : [ "CVE-2019-10770" ],
"summary" : "Default development error handler in Ratpack is vulnerable to HTML content injection (XSS)",
"details" : "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')](https://cwe.mitre.org/data/definitions/79.html) (aka. XSS) in the development error handler. An attacker can utilize this to perform XSS when an exception message contains untrusted data.\n\nAs a simplistic example:\n```java\nRatpackServer startedServer = RatpackServer.start(server -> {\n server.handlers(chain -> chain.all(ctx -> {\n // User supplied query parameter\n String message = ctx.getRequest().getQueryParams().get(\"message\");\n // User supplied data appended to the message in an exception\n throw new RuntimeException(\"An error occurred: \" + message);\n }));\n});\n```\n\n### Impact\n\n - Cross-Site Scripting\n\n### Patches\n\nThis vulnerability has been patched in Ratpack version 1.7.6.\n\n### Workarounds\n\nIf you are unable to update your version of Ratpack, we recommend the following workarounds and mitigations.\n\n - Ensure that development mode is disabled in production.\n - Don't use real customer data (ie. untrusted user input) in development.\n\n### References\n\n - [Ratpack development mode](https://ratpack.io/manual/current/api/ratpack/server/ServerConfigBuilder.html#development-boolean-)\n - [Code Patch - a3cbb13](https://github.com/ratpack/ratpack/commit/a3cbb13be1527874528c3b99fc33517c0297b6d3)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n - Open an issue in [ratpack/ratpack](https://github.com/ratpack/ratpack/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)\n - Ask in our [Slack channel](https://slack-signup.ratpack.io/)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.ratpack:ratpack-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ratpack/ratpack/security/advisories/GHSA-r2wf-q3x4-hrv9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-10770"
}, {
"type" : "WEB",
"url" : "https://github.com/ratpack/ratpack/commit/a3cbb13be1527874528c3b99fc33517c0297b6d3"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-IORATPACK-534882"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-01-27T18:23:23Z",
"nvd_published_at" : null
}
}