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-46478

CVE-2024-46478: Htmldoc Buffer Overflow Vulnerability

CVE-2024-46478 is a buffer overflow vulnerability in Htmldoc v1.9.18 affecting the parse_pre function in ps-pdf.cxx. This flaw can lead to crashes or code execution. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: March 31, 2026

CVE-2024-46478 Overview

A buffer overflow vulnerability has been identified in HTMLDOC v1.9.18, specifically within the parse_pre function located in ps-pdf.cxx at line 5681. HTMLDOC is a widely-used open-source application that converts HTML and Markdown source files into various output formats including PostScript and PDF. This vulnerability allows remote attackers to potentially achieve code execution or cause denial of service through specially crafted input files.

Critical Impact

This buffer overflow vulnerability in HTMLDOC v1.9.18 can be exploited remotely without authentication, potentially allowing attackers to execute arbitrary code or crash the application when processing malicious HTML documents.

Affected Products

  • HTMLDOC v1.9.18
  • htmldoc_project htmldoc

Discovery Timeline

  • 2024-10-24 - CVE-2024-46478 published to NVD
  • 2025-06-24 - Last updated in NVD database

Technical Details for CVE-2024-46478

Vulnerability Analysis

This vulnerability is classified as CWE-120 (Buffer Copy without Checking Size of Input), commonly known as a classic buffer overflow. The flaw exists in the parse_pre function within the ps-pdf.cxx source file, which handles preformatted text blocks during HTML to PDF/PostScript conversion.

The core issue stems from improper boundary checking when processing tab characters within preformatted text. When the function encounters tab characters, it expands them into spaces, but the original boundary check did not account for the maximum possible expansion size of a tab character (up to 8 spaces). This oversight allows data to be written beyond the allocated buffer boundaries.

The vulnerability is exploitable over the network as HTMLDOC can process remotely-sourced HTML files, and exploitation requires no authentication or user interaction beyond triggering the document conversion process.

Root Cause

The root cause is insufficient buffer boundary validation in the parse_pre function when handling tab character expansion. The original code used a boundary check of sizeof(line) - 1, which failed to account for the fact that a single tab character can expand to multiple space characters (up to 8). This miscalculation creates a condition where the buffer can overflow when processing input containing tab characters near the end of the allocated buffer space.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious HTML document containing preformatted text (<pre> blocks) with strategically placed tab characters. When HTMLDOC processes this document to convert it to PDF or PostScript format, the buffer overflow occurs during tab expansion, potentially allowing:

  1. Remote Code Execution: Overwriting return addresses or function pointers to redirect execution flow
  2. Denial of Service: Crashing the application through memory corruption
  3. Information Disclosure: Leaking sensitive memory contents in certain scenarios

The attack can be delivered through any workflow that processes untrusted HTML documents with HTMLDOC, including web applications, document conversion services, or automated document processing pipelines.

text
 
 	case MARKUP_NONE :
             for (lineptr = line, dataptr = start->data;
-		 *dataptr != '\0' && lineptr < (line + sizeof(line) - 1);
+		 *dataptr != '\0' && lineptr < (line + sizeof(line) - 9);
 	         dataptr ++)
+	    {
               if (*dataptr == '\n')
+              {
 		break;
+              }
               else if (*dataptr == '\t')
               {
                /* This code changed after 15 years to work around new compiler optimization bugs (Issue #349) */

Source: GitHub Commit 683bec5

The patch changes the boundary check from sizeof(line) - 1 to sizeof(line) - 9, reserving sufficient space for the maximum tab expansion (8 characters) plus the null terminator.

Detection Methods for CVE-2024-46478

Indicators of Compromise

  • Unexpected crashes or segmentation faults in HTMLDOC processes during document conversion
  • Abnormal memory usage patterns when processing HTML files with preformatted text blocks
  • Core dumps or crash logs referencing parse_pre function or ps-pdf.cxx
  • Unusual HTML files containing excessive or strategically placed tab characters in <pre> blocks

Detection Strategies

  • Monitor HTMLDOC process behavior for abnormal terminations or memory access violations
  • Implement file integrity monitoring on HTMLDOC binaries to detect unauthorized modifications
  • Deploy application-level logging to capture conversion failures and error conditions
  • Use static analysis tools to identify vulnerable HTMLDOC versions in your environment

Monitoring Recommendations

  • Audit systems for installations of HTMLDOC version 1.9.18 using software inventory tools
  • Enable core dump analysis for early detection of exploitation attempts
  • Monitor for unusual patterns in HTML document submissions to conversion services
  • Implement input validation for HTML files before processing with HTMLDOC

How to Mitigate CVE-2024-46478

Immediate Actions Required

  • Update HTMLDOC to a patched version that includes commit 683bec548e642cf4a17e003fb34f6bbaf2d27b98
  • Audit systems for vulnerable HTMLDOC v1.9.18 installations
  • Restrict access to HTMLDOC conversion services to trusted users only
  • Implement input sanitization for HTML files before processing

Patch Information

The vulnerability has been addressed by the HTMLDOC project maintainer through a security commit. The fix modifies the boundary check in the parse_pre function to properly account for tab character expansion, changing the buffer limit from sizeof(line) - 1 to sizeof(line) - 9. Organizations should apply the patch available in the GitHub commit or upgrade to a version that includes this fix.

Workarounds

  • Restrict HTMLDOC usage to trusted, internally-generated HTML documents only
  • Implement a preprocessing step to strip or replace tab characters from HTML input files
  • Run HTMLDOC in a sandboxed environment with limited system access
  • Disable or limit access to document conversion services using vulnerable HTMLDOC versions
bash
# Check installed HTMLDOC version
htmldoc --version

# Example: Strip tabs from HTML before processing (temporary workaround)
sed 's/\t/        /g' input.html > sanitized.html
htmldoc sanitized.html -f output.pdf

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechHtmldoc

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.27%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-120
  • Technical References
  • GitHub Issue Discussion
  • Vendor Resources
  • GitHub Commit Update
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal 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