Vulnerability · Published Aug 29, 2022 · Assigned by GitHub_M
CVE-2022-36033jsoup may not sanitize Cross-Site Scripting (XSS) attempts if SafeList.preserveRelativeLinks is enabled
Medium 6.1
In plain English
A medium-severity cross-site scripting in jsoup from jhy. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.6% (higher than 77% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
jsoup is a Java HTML parser, built for HTML editing, cleaning, scraping, and cross-site scripting (XSS) safety. jsoup may incorrectly sanitize HTML including `javascript:` URL expressions, which could allow XSS attacks when a reader subsequently clicks that link. If the non-default `SafeList.preserveRelativeLinks` option is enabled, HTML including `javascript:` URLs that have been crafted with control characters will not be sanitized. If the site that this HTML is published on does not set a Content Security Policy, an XSS attack is then possible. This issue is patched in jsoup 1.15.3. Users should upgrade to this version. Additionally, as the unsanitized input may have been persisted, old content should be cleaned again using the updated version. To remediate this issue without immediately upgrading: - disable `SafeList.preserveRelativeLinks`, which will rewrite input URLs as absolute URLs - ensure an appropriate [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) is defined. (This should be used regardless of upgrading, as a defence-in-depth best practice.)
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | jsoup | 1.15.3-1 | DEBIAN-CVE-2022-36033 |
| Debian:13 | jsoup | 1.15.3-1 | DEBIAN-CVE-2022-36033 |
| Debian:14 | jsoup | 1.15.3-1 | DEBIAN-CVE-2022-36033 |
| Maven | org.jsoup:jsoup | 1.15.3 | GHSA-gp7f-rwcx-9369 |
| Ubuntu:22.04:LTS | jsoup | no fix listed | UBUNTU-CVE-2022-36033 |
| Ubuntu:24.04:LTS | jsoup | no fix listed | UBUNTU-CVE-2022-36033 |
| Ubuntu:25.10 | jsoup | no fix listed | UBUNTU-CVE-2022-36033 |
| Ubuntu:26.04:LTS | jsoup | no fix listed | UBUNTU-CVE-2022-36033 |
| Ubuntu:26.10 | jsoup | no fix listed | UBUNTU-CVE-2022-36033 |
Affected products (as reported)
Weakness: CWE-87, CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N