CVE-2025-66021: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in OWASP java-html-sanitizer
OWASP Java HTML Sanitizer is a configureable HTML Sanitizer written in Java, allowing inclusion of HTML authored by third-parties in web applications while protecting against XSS. In version 20240325.1, OWASP java html sanitizer is vulnerable to XSS if HtmlPolicyBuilder allows noscript and style tags with allowTextIn inside the style tag. This could lead to XSS if the payload is crafted in such a way that it does not sanitise the CSS and allows tags which is not mentioned in HTML policy. At time of publication no known patch is available.
AI Analysis
Technical Summary
The OWASP Java HTML Sanitizer is a configurable library designed to safely include third-party HTML content in Java web applications by sanitizing potentially dangerous input to prevent cross-site scripting (XSS). In version 20240325.1, a vulnerability (CVE-2025-66021) was identified where the HtmlPolicyBuilder allows the inclusion of noscript and style tags with the allowTextIn directive inside the style tag. This configuration flaw permits attackers to craft payloads that bypass the sanitizer's CSS sanitization mechanisms, enabling injection of malicious scripts or styles that can execute arbitrary JavaScript in the victim's browser. The vulnerability stems from improper neutralization of input during web page generation, classified under CWE-79. The attack vector is network-based with no privileges required and no authentication needed, but user interaction is necessary to trigger the XSS. The vulnerability affects confidentiality and integrity by enabling script execution that can steal session tokens, perform actions on behalf of users, or manipulate page content. At the time of publication, no patch or fix is available, increasing the urgency for defensive measures. Although no known exploits are currently in the wild, the high CVSS score (8.6) reflects the potential impact and ease of exploitation. The vulnerability is particularly relevant for applications that rely on this sanitizer to safely render third-party HTML content, especially when policies permit the problematic tags and directives.
Potential Impact
For European organizations, this vulnerability poses a significant risk to web applications that incorporate third-party HTML content and use the OWASP Java HTML Sanitizer version 20240325.1. Successful exploitation can lead to theft of sensitive user data such as authentication tokens, session hijacking, unauthorized actions performed on behalf of users, and defacement or manipulation of web content. This can damage organizational reputation, lead to regulatory non-compliance (e.g., GDPR breaches), and cause financial losses. The vulnerability's ability to bypass sanitization of CSS and inject scripts increases the attack surface, especially in sectors with high web application usage such as finance, e-commerce, and public services. Since no patch is currently available, organizations face increased exposure until mitigations are applied. The requirement for user interaction means phishing or social engineering could be used to trigger the exploit, increasing risk in environments with high user traffic and diverse user bases.
Mitigation Recommendations
1. Immediately review and modify HtmlPolicyBuilder configurations to disallow noscript and style tags with allowTextIn inside style tags until a patch is released. 2. Implement additional server-side input validation and output encoding to complement the sanitizer, focusing on CSS content and style-related inputs. 3. Employ Content Security Policy (CSP) headers to restrict script execution and mitigate the impact of potential XSS attacks. 4. Conduct thorough code audits and penetration testing on web applications using this sanitizer version to identify and remediate exploitable injection points. 5. Educate developers and security teams about the vulnerability and safe configuration practices for HTML sanitization. 6. Monitor OWASP and vendor channels for updates or patches and plan prompt deployment once available. 7. Consider alternative sanitization libraries or versions not affected by this vulnerability if immediate mitigation is required. 8. Enhance user awareness to reduce the risk of social engineering attacks that could trigger the vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden
CVE-2025-66021: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in OWASP java-html-sanitizer
Description
OWASP Java HTML Sanitizer is a configureable HTML Sanitizer written in Java, allowing inclusion of HTML authored by third-parties in web applications while protecting against XSS. In version 20240325.1, OWASP java html sanitizer is vulnerable to XSS if HtmlPolicyBuilder allows noscript and style tags with allowTextIn inside the style tag. This could lead to XSS if the payload is crafted in such a way that it does not sanitise the CSS and allows tags which is not mentioned in HTML policy. At time of publication no known patch is available.
AI-Powered Analysis
Technical Analysis
The OWASP Java HTML Sanitizer is a configurable library designed to safely include third-party HTML content in Java web applications by sanitizing potentially dangerous input to prevent cross-site scripting (XSS). In version 20240325.1, a vulnerability (CVE-2025-66021) was identified where the HtmlPolicyBuilder allows the inclusion of noscript and style tags with the allowTextIn directive inside the style tag. This configuration flaw permits attackers to craft payloads that bypass the sanitizer's CSS sanitization mechanisms, enabling injection of malicious scripts or styles that can execute arbitrary JavaScript in the victim's browser. The vulnerability stems from improper neutralization of input during web page generation, classified under CWE-79. The attack vector is network-based with no privileges required and no authentication needed, but user interaction is necessary to trigger the XSS. The vulnerability affects confidentiality and integrity by enabling script execution that can steal session tokens, perform actions on behalf of users, or manipulate page content. At the time of publication, no patch or fix is available, increasing the urgency for defensive measures. Although no known exploits are currently in the wild, the high CVSS score (8.6) reflects the potential impact and ease of exploitation. The vulnerability is particularly relevant for applications that rely on this sanitizer to safely render third-party HTML content, especially when policies permit the problematic tags and directives.
Potential Impact
For European organizations, this vulnerability poses a significant risk to web applications that incorporate third-party HTML content and use the OWASP Java HTML Sanitizer version 20240325.1. Successful exploitation can lead to theft of sensitive user data such as authentication tokens, session hijacking, unauthorized actions performed on behalf of users, and defacement or manipulation of web content. This can damage organizational reputation, lead to regulatory non-compliance (e.g., GDPR breaches), and cause financial losses. The vulnerability's ability to bypass sanitization of CSS and inject scripts increases the attack surface, especially in sectors with high web application usage such as finance, e-commerce, and public services. Since no patch is currently available, organizations face increased exposure until mitigations are applied. The requirement for user interaction means phishing or social engineering could be used to trigger the exploit, increasing risk in environments with high user traffic and diverse user bases.
Mitigation Recommendations
1. Immediately review and modify HtmlPolicyBuilder configurations to disallow noscript and style tags with allowTextIn inside style tags until a patch is released. 2. Implement additional server-side input validation and output encoding to complement the sanitizer, focusing on CSS content and style-related inputs. 3. Employ Content Security Policy (CSP) headers to restrict script execution and mitigate the impact of potential XSS attacks. 4. Conduct thorough code audits and penetration testing on web applications using this sanitizer version to identify and remediate exploitable injection points. 5. Educate developers and security teams about the vulnerability and safe configuration practices for HTML sanitization. 6. Monitor OWASP and vendor channels for updates or patches and plan prompt deployment once available. 7. Consider alternative sanitization libraries or versions not affected by this vulnerability if immediate mitigation is required. 8. Enhance user awareness to reduce the risk of social engineering attacks that could trigger the vulnerability.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-11-21T01:08:02.613Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69265f3eca41832e1e61653e
Added to database: 11/26/2025, 2:00:30 AM
Last enriched: 12/3/2025, 4:26:52 AM
Last updated: 12/4/2025, 10:21:04 PM
Views: 117
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-10285: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in silabs.com Simplicity Studio V6
HighCVE-2025-1910: CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection') in WatchGuard Mobile VPN with SSL Client
MediumCVE-2025-12986: CWE-410 Insufficient Resource Pool in silabs.com Gecko SDK
MediumCVE-2025-53704: CWE-640 in MAXHUB Pivot client application
HighCVE-2025-12196: CWE-787 Out-of-bounds Write in WatchGuard Fireware OS
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.