jsoup may not sanitize Cross-Site Scripting (XSS) attempts if SafeList.preserveRelativeLinks is enabled
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 is defined. (This should be used regardless of upgrading, as a defence-in-depth best practice.)
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.jsoup:jsoupMaven | < 1.15.3 | 1.15.3 |
Affected products
8- osv-coords7 versionspkg:apk/chainguard/dottypkg:apk/wolfi/dottypkg:maven/org.jsoup/jsouppkg:rpm/opensuse/jsoup&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/jsoup&distro=openSUSE%20Leap%2015.4pkg:rpm/suse/jsoup&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP3pkg:rpm/suse/jsoup&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4
< 3.4.0-r0+ 6 more
- (no CPE)range: < 3.4.0-r0
- (no CPE)range: < 3.4.0-r0
- (no CPE)range: < 1.15.3
- (no CPE)range: < 1.15.3-150200.3.6.1
- (no CPE)range: < 1.15.3-150200.3.6.1
- (no CPE)range: < 1.15.3-150200.3.6.1
- (no CPE)range: < 1.15.3-150200.3.6.1
- jhy/jsoupv5Range: < 1.15.3
Patches
Vulnerability mechanics
References
7- github.com/advisories/GHSA-gp7f-rwcx-9369ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-36033ghsaADVISORY
- github.com/jhy/jsoup/releases/tag/jsoup-1.15.3ghsaWEB
- github.com/jhy/jsoup/security/advisories/GHSA-gp7f-rwcx-9369ghsaWEB
- jsoup.org/news/release-1.15.3ghsaWEB
- security.netapp.com/advisory/ntap-20221104-0006ghsaWEB
- security.netapp.com/advisory/ntap-20221104-0006/mitre
News mentions
0No linked articles in our index yet.