# CVE-2026-71497: jsoup XSS in Cleaner with custom Safelist raw-text elements

Source: https://junglewise.ai/threats/cve-2026-71497-jsoup-xss-in-cleaner-with-custom-safelist-raw-text-elements  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-06. Updated: 2026-08-06  
License: CC BY 4.0 with a link back

CVE-2026-71497 · Severity: medium · CVSS 4.7 · Published 2026-08-06

jsoup is a popular Java library used to parse and clean HTML content. A vulnerability exists where the library may fail to properly sanitize malicious web content when using custom security rules, potentially allowing an attacker to execute unauthorized scripts in a user's browser (Cross-Site Scripting). This could lead to the theft of user sessions or the unauthorized modification of web pages.

Technologies: [org.jsoup:jsoup (Maven)](https://junglewise.ai/threats/technologies/org-jsoup-jsoup). Vendors: [Maven](https://junglewise.ai/threats/vendors/maven).

## Quick answers

**Is CVE-2026-71497 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-71497 being exploited in the wild.

**How severe is CVE-2026-71497?** Medium severity, with a CVSS score of 4.7, published 6 August 2026.

**Which products and versions are affected?** Jsoup >= 1.14.3, < 1.23.1; org.jsoup:jsoup (Maven) >= 1.14.3, < 1.23.1, ECOSYSTEM:introduced=1.14.3,fixed=1.23.1.

**Is there a fix for CVE-2026-71497?** Yes. org.jsoup:jsoup (Maven): upgrade to 1.23.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-71497 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-71497?** Check whether you run Jsoup or org.jsoup:jsoup (Maven) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- org.jsoup:jsoup (Maven): upgrade to 1.23.1 or later

  ```sh
  # set org.jsoup:jsoup to 1.23.1 in your pom.xml or build.gradle
  ```


## Technical details

A Cross-Site Scripting (XSS) vulnerability exists in jsoup's Cleaner component when using custom Safelists that permit raw-text elements. The root cause is improper handling of malformed HTML tag names that end in control characters. During parsing, such tags may acquire the behavior of different elements, causing content intended to be treated as plain text to be emitted as active markup after serialization. This allows an attacker to bypass sanitization and inject executable scripts. The vulnerability is present in versions 1.14.3 through 1.23.0 and is fixed in version 1.23.1. Built-in Safelists are not affected.

## Affected products

- jhy jsoup >= 1.14.3, < 1.23.1

## Identifiers

- CVE-2026-71497
- GHSA-pmhh-3w7g-xqp8

## Timeline

- 2026-07-30: disclosed: Initial disclosure by jhy
- 2026-08-06: advisory: GitHub Advisory published
- 2026-08-06: patched: Version 1.23.1 released

## References

- [https://api.github.com/users/quitbug](https://api.github.com/users/quitbug)
- [https://github.com/quitbug](https://github.com/quitbug)
- [https://api.github.com/users/quitbug/gists%7B/gist_id%7D](https://api.github.com/users/quitbug/gists%7B/gist_id%7D)
- [https://api.github.com/users/quitbug/repos](https://api.github.com/users/quitbug/repos)
- [https://avatars.githubusercontent.com/u/155615252?v=4](https://avatars.githubusercontent.com/u/155615252?v=4)
- [https://api.github.com/users/quitbug/events%7B/privacy%7D](https://api.github.com/users/quitbug/events%7B/privacy%7D)

## Related threats

- [jsoup XML namespace handling denial of service](https://junglewise.ai/threats/cve-2026-75140-jsoup-xml-namespace-handling-denial-of-service)
- [jsoup may not sanitize code injection XSS attempts if SafeList.preserveRelativeLinks is enabled](https://junglewise.ai/threats/cve-2022-36033-jsoup-may-not-sanitize-code-injection-xss-attempts-if-safelist)
- [Improper Neutralization of Input During Web Page Generation in Jsoup](https://junglewise.ai/threats/cve-2015-6748-improper-neutralization-of-input-during-web-page-generation-in)
- [Uncaught Exception in jsoup](https://junglewise.ai/threats/cve-2021-37714-uncaught-exception-in-jsoup)
