A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-66021

CVE-2025-66021: OWASP Java HTML Sanitizer XSS Flaw

CVE-2025-66021 is a cross-site scripting vulnerability in OWASP Java HTML Sanitizer affecting version 20240325.1. Attackers can bypass sanitization through crafted CSS payloads. This article covers technical details, impact, and mitigation.

Published: May 26, 2026

CVE-2025-66021 Overview

CVE-2025-66021 is a Cross-Site Scripting (XSS) vulnerability [CWE-79] in the OWASP Java HTML Sanitizer, a configurable library used to safely include third-party HTML in web applications. The flaw affects version 20240325.1 when HtmlPolicyBuilder is configured to allow noscript and style tags with allowTextIn inside the style tag. Attackers can craft payloads that bypass CSS sanitization and inject tags not permitted by the configured HTML policy. At the time of publication, no patch is available from the OWASP project.

Critical Impact

Successful exploitation enables script execution in the victim's browser, leading to session theft, credential harvesting, and unauthorized actions performed in the user's authenticated context.

Affected Products

  • OWASP Java HTML Sanitizer version 20240325.1
  • Java web applications using HtmlPolicyBuilder with noscript and style tags allowed
  • Applications configured with allowTextIn inside style tags

Discovery Timeline

  • 2025-11-26 - CVE-2025-66021 published to NVD
  • 2025-12-30 - Last updated in NVD database

Technical Details for CVE-2025-66021

Vulnerability Analysis

The OWASP Java HTML Sanitizer is designed to filter untrusted HTML and prevent XSS while permitting safe markup defined by a configurable policy. The library fails to correctly sanitize content when a policy concurrently permits noscript elements and style elements that accept text via allowTextIn. An attacker can craft input that smuggles unsanitized markup through this configuration path. The sanitizer does not strip dangerous CSS or tag content within the style element under these conditions. Browsers ultimately render the attacker-controlled content as executable script in the trusted page context.

Root Cause

The root cause is incomplete CSS and tag sanitization logic when noscript and style tags are both allowed and allowTextIn is enabled for style. The parser treats text within style blocks differently depending on whether noscript parsing is active. This parser-state mismatch allows tags that the configured HtmlPolicyBuilder would normally reject to survive sanitization. The flaw is a classic improper neutralization of input during web page generation [CWE-79].

Attack Vector

Exploitation requires an attacker to submit crafted HTML to an application that passes user content through a vulnerable HtmlPolicyBuilder configuration. The attack is network-reachable and requires user interaction, since the victim must load the rendered page containing the sanitized output. No authentication or privileges are required on the targeted application. Successful exploitation executes arbitrary JavaScript under the origin of the hosting application. See the OWASP GitHub Security Advisory GHSA-g9gq-3pfx-2gw2 for technical details on the policy configurations that trigger the issue.

Detection Methods for CVE-2025-66021

Indicators of Compromise

  • Inbound HTTP payloads containing nested <noscript> and <style> tags with unexpected child markup
  • Sanitizer output retaining <script>, event handler attributes, or tags not declared in the active policy
  • Anomalous outbound requests from rendered pages indicating script execution against attacker-controlled hosts

Detection Strategies

  • Audit Java application dependencies for owasp:java_html_sanitizer:20240325.1 using software composition analysis tooling
  • Review HtmlPolicyBuilder configurations that call allowElements("noscript", "style") combined with allowTextIn("style")
  • Compare sanitizer input and output in logs to identify tags surviving filtration that are outside the declared policy

Monitoring Recommendations

  • Log all HTML sanitization operations and alert on output containing <script>, on* attributes, or javascript: URIs
  • Enable Content Security Policy (CSP) reporting endpoints to capture script execution attempts from sanitized content
  • Monitor web application firewall (WAF) telemetry for payloads combining noscript and style elements in user-submitted HTML

How to Mitigate CVE-2025-66021

Immediate Actions Required

  • Inventory applications using OWASP Java HTML Sanitizer version 20240325.1 and identify those exposing user-generated HTML
  • Remove noscript and style from any HtmlPolicyBuilder allowlist until a patched release is available
  • Disable allowTextIn for style tags across all sanitizer policies
  • Deploy a strict Content Security Policy that blocks inline script execution as a defense-in-depth control

Patch Information

At time of publication, no patch is available from the OWASP project. Track the OWASP Java HTML Sanitizer Security Advisory for fix availability and upgrade guidance.

Workarounds

  • Restrict HtmlPolicyBuilder policies to exclude noscript and style elements entirely
  • Route user-submitted HTML through a secondary allowlist filter that strips style content before sanitization
  • Apply CSP headers with script-src 'self' and style-src 'self' to limit impact if bypass occurs
  • Encode rendered HTML output server-side when full HTML support is not required
bash
# Example HtmlPolicyBuilder configuration removing vulnerable elements
# Avoid: .allowElements("noscript", "style").allowTextIn("style")
# Use a minimal policy until a patched release is available:
#   PolicyFactory policy = new HtmlPolicyBuilder()
#       .allowElements("p", "a", "b", "i", "em", "strong", "ul", "ol", "li")
#       .allowUrlProtocols("https")
#       .allowAttributes("href").onElements("a")
#       .toFactory();

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechOwasp Java Html Sanitizer

  • SeverityHIGH

  • CVSS Score8.6

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Vendor Resources
  • GitHub Security Advisory
  • Latest CVEs
  • CVE-2024-8261: Prolizyazilim OBS Auth Bypass Vulnerability

  • CVE-2024-13068: LimonDesk Auth Bypass Vulnerability

  • CVE-2025-53679: Fortinet FortiSandbox RCE Vulnerability

  • CVE-2026-9446: Simple POS Inventory System SQLi Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English