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
    • 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-2021-23424

CVE-2021-23424: Ansi-html DoS Vulnerability

CVE-2021-23424 is a denial of service vulnerability in the ansi-html package that causes extreme processing delays when malicious strings are provided. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-23424 Overview

CVE-2021-23424 is a Denial of Service vulnerability affecting all versions of the ansi-html npm package. The ansi-html library is commonly used to convert ANSI escape codes to HTML, making it popular in web development build tools, terminals, and logging applications. When an attacker provides a maliciously crafted string to the vulnerable function, the package becomes stuck processing the input for an extremely long time, effectively causing a Denial of Service condition.

Critical Impact

All versions of the ansi-html package are vulnerable to algorithmic complexity attacks that can render applications unresponsive when processing attacker-controlled input.

Affected Products

  • ansi-html (all versions) for Node.js
  • Applications and build tools that depend on ansi-html as a dependency
  • WebJars npm packages containing ansi-html (org.webjars.npm)

Discovery Timeline

  • 2021-08-18 - CVE-2021-23424 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-23424

Vulnerability Analysis

This vulnerability is classified as an Algorithmic Complexity Attack, a type of Denial of Service where inefficient processing of input leads to excessive resource consumption. The ansi-html package processes ANSI escape codes to convert them into HTML markup. However, when handling certain malicious input patterns, the parsing logic enters a state where it consumes disproportionate CPU time relative to the input size.

The vulnerability is particularly concerning because ansi-html is a transitive dependency in many popular development tools and build systems, including webpack-dev-server and other development middleware. This means applications may be vulnerable without directly importing the package.

Root Cause

The root cause lies in the string processing algorithm used to parse ANSI escape sequences. When presented with specially crafted input strings, the parsing logic fails to handle edge cases efficiently, resulting in catastrophic backtracking or excessive loop iterations. This causes the Node.js event loop to block while processing the malicious input, preventing the application from handling other requests or operations.

Attack Vector

The attack vector is network-based, requiring no authentication or user interaction. An attacker can exploit this vulnerability by sending a malicious string to any application endpoint that processes user input through the ansi-html library. Common attack scenarios include:

The vulnerability can be triggered when malicious ANSI sequences are passed to the conversion function. An attacker could submit specially crafted terminal output or log data that, when processed by ansi-html, causes the application to hang. Since the package is often used in development servers and logging systems, attackers may target exposed development endpoints or log processing pipelines.

The attack does not require authentication and can be performed remotely over the network. The malicious payload causes the vulnerable function to enter a computationally expensive loop, consuming CPU resources and blocking the application's event loop until processing completes—which may take an impractically long time.

Detection Methods for CVE-2021-23424

Indicators of Compromise

  • Unexpected CPU spikes in Node.js processes that correlate with incoming requests
  • Application hangs or timeouts when processing specific user-supplied strings containing ANSI-like sequences
  • Event loop blocking detected through Node.js monitoring tools
  • Increased response times or complete unresponsiveness from services using ansi-html

Detection Strategies

  • Implement Software Composition Analysis (SCA) tools to identify ansi-html in your dependency tree using npm ls ansi-html or yarn why ansi-html
  • Monitor Node.js process metrics for event loop lag exceeding normal thresholds
  • Deploy Application Performance Monitoring (APM) tools to detect abnormal request processing times
  • Use runtime protection tools to detect and terminate requests with excessive processing duration

Monitoring Recommendations

  • Configure alerts for sustained high CPU utilization in Node.js application processes
  • Implement request timeout mechanisms at the application and infrastructure layer
  • Monitor for patterns of requests containing unusual or malformed ANSI escape sequences
  • Enable detailed logging for input processing functions to aid in incident investigation

How to Mitigate CVE-2021-23424

Immediate Actions Required

  • Audit your application's dependency tree to determine if ansi-html is present using npm ls ansi-html or equivalent
  • Consider replacing ansi-html with actively maintained alternatives such as ansi-to-html
  • Implement input validation and sanitization before passing data to ANSI processing functions
  • Deploy request timeouts and circuit breakers to limit the impact of DoS attacks

Patch Information

As of the last NVD update, no official patch has been released by the package maintainer. The ansi-html package appears to be unmaintained based on the GitHub Issue Discussion. Organizations should consider migrating to alternative packages that provide similar functionality with active security support.

For additional vulnerability details, refer to the Snyk JS Advisory and Snyk Java Advisory.

Workarounds

  • Replace the ansi-html dependency with actively maintained alternatives like ansi-to-html or @nuxtjs/ansi-to-html
  • Implement strict input length limits for any data that will be processed by ANSI conversion functions
  • Deploy Web Application Firewall (WAF) rules to filter requests containing suspicious ANSI escape patterns
  • Isolate ANSI processing to worker threads or separate processes with resource limits and timeouts
bash
# Check if ansi-html is in your dependency tree
npm ls ansi-html

# Replace with an actively maintained alternative
npm uninstall ansi-html
npm install ansi-to-html

# Verify the replacement
npm ls ansi-to-html

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechAnsi Html

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.20%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • GitHub Issue Discussion

  • Snyk Java Vulnerability SNYK-JAVA-ORGWEBJARSNPM-1567198

  • Snyk JS Vulnerability SNYK-JS-ANSIHTML-1296849
  • Latest CVEs
  • CVE-2025-52479: HTTP.jl & URIs.jl CRLF Injection Flaw

  • CVE-2026-31740: Linux Kernel Race Condition Vulnerability

  • CVE-2026-31743: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31744: Linux Kernel NULL Pointer 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