The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2024-23635

CVE-2024-23635: AntiSamy HTML Sanitization XSS Vulnerability

CVE-2024-23635 is a mutation XSS vulnerability in AntiSamy that affects HTML sanitization when preserveComments is enabled. Attackers can bypass filters to inject malicious code. This article covers technical details, affected versions, impact, and mitigation steps.

Updated: January 22, 2026

CVE-2024-23635 Overview

CVE-2024-23635 is a mutation XSS (mXSS) vulnerability in AntiSamy, a widely-used library for performing fast, configurable cleansing of HTML coming from untrusted sources. Prior to version 1.7.5, flawed parsing of HTML being sanitized can lead to executable code being interpreted when the sanitized output is rendered in a browser.

Critical Impact

When the preserveComments directive is enabled in the AntiSamy policy file, crafted inputs can bypass sanitization, resulting in elements within comment tags being interpreted as executable JavaScript. This allows attackers to inject malicious scripts that execute in victims' browsers.

Affected Products

  • AntiSamy versions prior to 1.7.5
  • Applications using AntiSamy with preserveComments directive enabled
  • Web applications relying on AntiSamy for HTML sanitization

Discovery Timeline

  • 2024-02-02 - CVE-2024-23635 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-23635

Vulnerability Analysis

This vulnerability represents a mutation XSS (mXSS) attack vector, a sophisticated class of Cross-Site Scripting (XSS) vulnerabilities. Unlike traditional XSS where malicious content is directly injected, mXSS exploits the differences between how HTML parsers interpret content during sanitization versus how browsers render the sanitized output.

The vulnerability specifically affects applications that have enabled the preserveComments directive in their AntiSamy policy configuration. When this setting is active, HTML comments are preserved through the sanitization process, creating an opportunity for attackers to craft payloads that appear benign during parsing but become executable when rendered by the browser.

Root Cause

The root cause lies in the flawed parsing logic within AntiSamy's HTML sanitization engine. The library fails to properly account for edge cases where HTML comment boundaries can be manipulated to hide executable content. When browsers re-interpret the sanitized output, they may parse the comment boundaries differently than AntiSamy did during sanitization, causing previously hidden script content to become executable.

This is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation), as the sanitizer fails to properly neutralize user-controllable input that could be interpreted as executable script.

Attack Vector

The attack requires network access and user interaction, as victims must visit a page containing the malicious sanitized content. Attackers can exploit this vulnerability by submitting specially crafted HTML content to any application feature that processes user input through AntiSamy with preserveComments enabled.

The mutation XSS technique works by exploiting parser differentials—the attacker crafts input that AntiSamy's parser interprets as safe comment content, but that browsers will interpret differently when rendering the output. This can allow script tags or event handlers hidden within or around comment boundaries to execute.

For detailed technical analysis and specific payload examples, refer to the GitHub Security Advisory.

Detection Methods for CVE-2024-23635

Indicators of Compromise

  • Unusual HTML comment structures in user-submitted content containing script-like patterns
  • Web application logs showing attempts to submit malformed or nested HTML comments
  • Browser console errors related to script execution from sanitized content areas
  • User reports of unexpected behavior or pop-ups on pages displaying user-generated content

Detection Strategies

  • Review application dependencies to identify AntiSamy versions prior to 1.7.5
  • Audit AntiSamy policy files for the preserveComments directive being set to true
  • Implement Web Application Firewall (WAF) rules to detect mXSS payload patterns in HTML comments
  • Deploy Content Security Policy (CSP) headers to detect and block inline script execution

Monitoring Recommendations

  • Enable logging for all HTML sanitization operations to capture potentially malicious input
  • Monitor for CSP violation reports indicating attempted script execution from sanitized content
  • Set up alerts for unusual patterns in user-submitted HTML, particularly around comment syntax
  • Implement runtime application security monitoring to detect XSS exploitation attempts

How to Mitigate CVE-2024-23635

Immediate Actions Required

  • Upgrade AntiSamy to version 1.7.5 or later immediately
  • Audit all AntiSamy policy files and disable preserveComments unless absolutely necessary
  • Review applications for any instances where sanitized output is rendered without additional encoding
  • Implement Content Security Policy headers to provide defense-in-depth against XSS

Patch Information

The vulnerability has been patched in AntiSamy version 1.7.5 and later. Organizations should update their AntiSamy dependency to the latest available version. The patch addresses the parser differential that allowed crafted HTML comments to bypass sanitization.

For complete patch details and release notes, see the GitHub Security Advisory.

Workarounds

  • Disable the preserveComments directive in your AntiSamy policy file by setting it to false
  • Apply additional output encoding to all AntiSamy-sanitized content before rendering
  • Implement strict Content Security Policy headers that block inline script execution
  • Consider using alternative HTML sanitization approaches for high-risk applications until patching is complete
bash
# Configuration example - Disable preserveComments in AntiSamy policy
# In your antisamy policy XML file, ensure this directive is disabled:
# <directive name="preserveComments" value="false"/>

# Maven dependency update to patched version
# Update pom.xml to use AntiSamy 1.7.5 or later:
# <dependency>
#     <groupId>org.owasp.antisamy</groupId>
#     <artifactId>antisamy</artifactId>
#     <version>1.7.5</version>
# </dependency>

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechAntisamy

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.16%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Vendor Resources
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2023-43643: AntiSamy Library mXSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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