GHSA-pmhh-3w7g-xqp8: XSS
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.jsoup:jsoupto a version that resolves this vulnerability.Fixed in 1.23.1 - Upgrade
Upgrade
jsoupto a version that resolves this vulnerability.Fixed in 1.23.1 - Configuration
Until upgrading, do not permit raw-text elements in custom Safelists used to clean untrusted HTML.
jsoup Safelist (custom) Permit raw-text elements = false
Event History
Frequently Asked Questions
What is the severity of GHSA-pmhh-3w7g-xqp8?
The severity of GHSA-pmhh-3w7g-xqp8 is medium with a score of 4.7.
What is the risk associated with GHSA-pmhh-3w7g-xqp8?
GHSA-pmhh-3w7g-xqp8 has a risk rating of 31.
How do I fix GHSA-pmhh-3w7g-xqp8?
To fix GHSA-pmhh-3w7g-xqp8, update to the latest version of jsoup that addresses this vulnerability.
What kind of vulnerability is GHSA-pmhh-3w7g-xqp8?
GHSA-pmhh-3w7g-xqp8 is classified as a Cross-Site Scripting (XSS) vulnerability.
What does GHSA-pmhh-3w7g-xqp8 affect?
GHSA-pmhh-3w7g-xqp8 affects the jsoup library within the Maven package.