MODERATE 4.7

CVE-2026-71497

jsoup: Cleaner may expose markup with custom raw-text elements

Description

When a custom Safelist permits certain raw-text elements, jsoup may incorrectly sanitize malformed HTML containing a tag name that ends in a control character. The tag may acquire the parsing behavior of a different element, causing content that should remain text to be emitted as active markup after serialization and potentially allowing XSS.

jsoup’s built-in Safelists are unaffected.

Patches

Upgrade to jsoup 1.23.1.

Workarounds

Until upgrading, do not permit raw-text elements in custom Safelists used to clean untrusted HTML.

Additional security considerations

This fix addresses malformed tag-name handling only.

Permitting raw-text elements in a custom Safelist does not make their contents inherently safe. For example, applications that permit style must apply appropriate CSS safeguards separately, because jsoup does not parse or sanitize CSS.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.jsoup » jsoup
>= 1.14.3, < 1.23.1
1.23.1

Blast radius

1affected artifacts
30affected versions
12,405dependent artifacts (est.)
467,084dependent versions

62% of the dependent artifacts (7,811) still pull an affected version in their latest release.

DepthDependent versions
Direct
50,161
2 hops
161,228
3 hops
155,213
4 hops
60,609
5 hops
28,673
6 hops
11,200

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.