ghsa-r2wf-q3x4-hrv9
Vulnerability from github
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:
java
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": [ { "package": { "ecosystem": "Maven", "name": "io.ratpack:ratpack-core" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "1.7.6" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2019-10770" ], "database_specific": { "cwe_ids": [ "CWE-79" ], "github_reviewed": true, "github_reviewed_at": "2020-01-27T18:23:23Z", "nvd_published_at": null, "severity": "MODERATE" }, "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 (\u0027Cross-site Scripting\u0027)](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 -\u003e {\n server.handlers(chain -\u003e chain.all(ctx -\u003e {\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\u0027t 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", "id": "GHSA-r2wf-q3x4-hrv9", "modified": "2021-08-19T16:44:56Z", "published": "2020-01-27T19:28:20Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "type": "CVSS_V3" } ], "summary": "Default development error handler in Ratpack is vulnerable to HTML content injection (XSS)" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.