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

CVE-2024-46954: Artifex Ghostscript Path Traversal Flaw

CVE-2024-46954 is a path traversal vulnerability in Artifex Ghostscript caused by overlong UTF-8 encoding that enables directory traversal attacks. This article covers technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2024-46954 Overview

CVE-2024-46954 is a directory traversal vulnerability discovered in the decode_utf8 function within base/gp_utf8.c in Artifex Ghostscript before version 10.04.0. The vulnerability occurs due to improper handling of overlong UTF-8 encoding sequences, which allows attackers to craft malicious input that bypasses path sanitization filters and achieves ../ directory traversal. This can enable unauthorized access to files outside the intended directory scope when processing specially crafted documents.

Critical Impact

Attackers can exploit overlong UTF-8 encoding to bypass path validation, potentially reading or writing files outside restricted directories during Ghostscript document processing operations.

Affected Products

  • Artifex Ghostscript versions prior to 10.04.0

Discovery Timeline

  • 2024-11-10 - CVE-2024-46954 published to NVD
  • 2025-08-15 - Last updated in NVD database

Technical Details for CVE-2024-46954

Vulnerability Analysis

The vulnerability resides in the UTF-8 decoding logic within Ghostscript's base/gp_utf8.c file. UTF-8 encoding uses a variable-length character encoding scheme where characters can be represented in 1-4 bytes. An "overlong" encoding occurs when a character is encoded using more bytes than necessary—for example, encoding the ASCII character / (U+002F) using two or more bytes instead of the required single byte.

The decode_utf8 function failed to properly reject these non-canonical overlong sequences. Attackers can exploit this by encoding path traversal sequences like ../ using overlong UTF-8 representations. Since many path validation routines check for the standard ASCII representation of ../, the overlong-encoded variant slips through the security checks, only to be decoded back to the dangerous sequence during later processing.

This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory, or 'Path Traversal').

Root Cause

The root cause stems from the decode_utf8 function not implementing strict UTF-8 validation according to RFC 3629. The function accepted overlong encodings as valid input rather than rejecting them as malformed UTF-8 sequences. Proper UTF-8 parsers must enforce that each code point is encoded using the minimum number of bytes required, rejecting any overlong sequences as invalid.

Attack Vector

Exploitation requires local access where a user must open a maliciously crafted document (such as a PostScript or PDF file) with Ghostscript. The malicious document contains file path references encoded with overlong UTF-8 sequences that represent directory traversal patterns. When Ghostscript processes the document and decodes these paths, the traversal sequences allow access to files outside the intended working directory.

The attack scenario involves:

  1. Crafting a document with path references using overlong UTF-8 encoding for ../ sequences
  2. Convincing a user to process the document with Ghostscript or an application that uses Ghostscript as a backend
  3. The overlong encoding bypasses input validation during initial parsing
  4. Upon UTF-8 decoding, the path resolves to unauthorized locations, enabling file read or write operations

Detection Methods for CVE-2024-46954

Indicators of Compromise

  • Unexpected file access patterns in directories outside Ghostscript's normal working scope
  • Processing of documents containing non-canonical UTF-8 sequences in path strings
  • Unusual Ghostscript process behavior accessing sensitive system files
  • Log entries showing file operations in unexpected directory locations

Detection Strategies

  • Monitor Ghostscript processes for file access attempts outside expected directories
  • Implement file integrity monitoring on sensitive system files and directories
  • Use application-level logging to capture file path operations during document processing
  • Deploy endpoint detection solutions that can identify path traversal attack patterns

Monitoring Recommendations

  • Enable verbose logging for Ghostscript operations to capture file access attempts
  • Configure SentinelOne Singularity Platform to monitor for suspicious file access patterns from Ghostscript processes
  • Implement alerts for any file read/write operations in sensitive directories initiated by document processing applications
  • Review system audit logs for unusual file access sequences during PostScript or PDF processing

How to Mitigate CVE-2024-46954

Immediate Actions Required

  • Upgrade Artifex Ghostscript to version 10.04.0 or later immediately
  • Review and restrict file system permissions for Ghostscript process execution
  • Implement additional input validation on documents before Ghostscript processing
  • Consider sandboxing Ghostscript operations to limit file system access scope

Patch Information

Artifex has addressed this vulnerability in Ghostscript version 10.04.0. The fix involves proper validation of UTF-8 sequences in the decode_utf8 function to reject overlong encodings as malformed input. The specific patch can be reviewed at the Ghostscript Commit #55f587d. Additional details about the issue are available in Ghostscript Bug Report #707788.

Workarounds

  • Run Ghostscript in a sandboxed or containerized environment with restricted file system access
  • Configure the -dSAFER flag when running Ghostscript to restrict file operations
  • Implement strict directory access controls limiting where Ghostscript can read or write files
  • Pre-validate documents using additional security tools before Ghostscript processing
bash
# Run Ghostscript with SAFER mode enabled to restrict file operations
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf input.ps

# Alternatively, use containerized execution with restricted mount points
docker run --rm -v /safe/input:/input:ro -v /safe/output:/output ghostscript-container gs -dSAFER input.ps

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechArtifex Ghostscript

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Technical References
  • Ghostscript Bug Report #707788

  • GitHub Ghostscript News Document
  • Vendor Resources
  • Ghostscript Commit #55f587d
  • Related CVEs
  • CVE-2024-46953: Ghostscript Path Traversal Vulnerability

  • CVE-2024-29511: Artifex Ghostscript Path Traversal Flaw

  • CVE-2025-27836: Artifex Ghostscript Buffer Overflow Flaw

  • CVE-2025-27832: Artifex Ghostscript Buffer Overflow Flaw
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