Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2023-43643

CVE-2023-43643: AntiSamy Library mXSS Vulnerability

CVE-2023-43643 is a mutation XSS flaw in AntiSamy library that allows crafted inputs to bypass sanitization when preserveComments is enabled. This article covers the technical details, affected versions, and mitigation steps.

Published: February 11, 2026

CVE-2023-43643 Overview

CVE-2023-43643 is a mutation XSS (mXSS) vulnerability in AntiSamy, a widely-used library for performing fast, configurable cleansing of HTML from untrusted sources. Prior to version 1.7.4, flawed parsing of HTML being sanitized can allow attackers to bypass sanitization controls when specific configuration options are enabled. This vulnerability affects applications that rely on AntiSamy to protect against cross-site scripting attacks.

Critical Impact

When the preserveComments directive is enabled in the policy file alongside certain permitted tags, crafted malicious inputs can cause elements within comment tags to be interpreted as executable code, completely bypassing the HTML sanitization intended to prevent XSS attacks.

Affected Products

  • AntiSamy versions prior to 1.7.4
  • Applications using AntiSamy with preserveComments directive enabled
  • Web applications relying on AntiSamy for HTML sanitization with permissive tag policies

Discovery Timeline

  • 2023-10-09 - CVE-2023-43643 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-43643

Vulnerability Analysis

This mutation XSS vulnerability arises from inconsistencies in how AntiSamy parses and processes HTML content, particularly within comment blocks. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation), which covers cross-site scripting vulnerabilities.

The flaw specifically manifests when the preserveComments configuration directive is enabled in the AntiSamy policy file. Under these conditions, the parsing logic fails to properly handle certain edge cases where HTML elements embedded within comment tags can "mutate" during the sanitization process. This mutation causes content that was originally inside comments (and thus seemingly harmless) to break out of the comment context and become executable HTML/JavaScript in the sanitized output.

The attack requires user interaction (a user must view the page containing the sanitized but malicious content), and successful exploitation can lead to limited confidentiality and integrity impacts through client-side script execution.

Root Cause

The root cause of CVE-2023-43643 lies in the HTML parsing logic within AntiSamy that handles comment preservation. When preserveComments is enabled, the parser attempts to maintain HTML comments in the sanitized output. However, the interaction between comment preservation and the allowlist of permitted HTML tags creates a parsing discrepancy.

Specifically, certain crafted input patterns can exploit differences between how AntiSamy's parser interprets the HTML structure versus how web browsers ultimately render the sanitized output. This parser differential allows malicious content to appear benign during sanitization but become active when rendered in the browser context.

Attack Vector

The attack vector is network-based, requiring an attacker to submit malicious HTML content to an application that uses AntiSamy for sanitization. The attack requires the following preconditions:

  1. The target application must use AntiSamy for HTML sanitization
  2. The AntiSamy policy must have preserveComments directive enabled
  3. The policy must allow certain HTML tags that facilitate the mutation
  4. A victim must view the page containing the sanitized output

The attacker crafts an HTML payload that leverages the parsing inconsistency. During sanitization, the payload passes through AntiSamy's checks because the malicious elements appear to be within comments. However, when the browser renders the sanitized HTML, the content "mutates" and breaks out of the comment context, executing as active HTML or JavaScript.

Since no verified code examples are available for this vulnerability, organizations should review the GitHub Security Advisory GHSA-pcf2-gh6g-h5r2 for technical details on the specific payload patterns that can trigger this vulnerability.

Detection Methods for CVE-2023-43643

Indicators of Compromise

  • Unusual HTML comment patterns in user-submitted content that contain nested angle brackets or script-like syntax
  • Web application logs showing HTML submissions with complex comment structures designed to confuse parsers
  • Client-side script execution errors or unexpected behavior in browsers rendering AntiSamy-sanitized content
  • Detection of XSS payloads in sanitized output that should have been filtered

Detection Strategies

  • Implement application-level logging to capture and analyze HTML content before and after AntiSamy sanitization
  • Deploy Web Application Firewalls (WAF) with rules to detect mutation XSS patterns and suspicious comment structures
  • Use browser-based XSS auditing tools to test sanitized output for executable content
  • Perform regular security scanning of applications using AntiSamy to identify mXSS bypass attempts

Monitoring Recommendations

  • Monitor application logs for repeated attempts to submit complex HTML with unusual comment nesting patterns
  • Set up alerts for any JavaScript execution in contexts where only sanitized HTML should be rendered
  • Track AntiSamy library versions across your application inventory to ensure vulnerable versions are identified
  • Implement Content Security Policy (CSP) headers and monitor for CSP violations that may indicate XSS attempts

How to Mitigate CVE-2023-43643

Immediate Actions Required

  • Upgrade AntiSamy to version 1.7.4 or later immediately across all affected applications
  • Review AntiSamy policy files and disable the preserveComments directive if not strictly required
  • Audit applications using AntiSamy to understand the scope of potential exposure
  • Implement additional output encoding as a defense-in-depth measure

Patch Information

The AntiSamy development team has addressed this vulnerability in version 1.7.4. Organizations should update their AntiSamy dependency to this version or later. The patch corrects the HTML parsing logic to properly handle comment preservation without allowing mutation XSS attacks.

For detailed patch information and release notes, refer to the AntiSamy v1.7.4 Release on GitHub.

Workarounds

  • Disable the preserveComments directive in your AntiSamy policy file if comment preservation is not a business requirement
  • Implement strict Content Security Policy (CSP) headers to mitigate the impact of any XSS that might bypass sanitization
  • Add an additional layer of output encoding after AntiSamy sanitization as a defense-in-depth measure
  • Review and restrict the HTML tags allowed in your AntiSamy policy to minimize the attack surface
xml
<!-- AntiSamy policy configuration - disable preserveComments -->
<directive name="preserveComments" value="false"/>

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.46%

  • 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 Antisamy Release v1.7.4

  • GitHub Security Advisory GHSA-pcf2-gh6g-h5r2
  • Related CVEs
  • CVE-2024-23635: AntiSamy HTML Sanitization XSS 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