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-2024-23496

CVE-2024-23496: Llama.cpp Buffer Overflow Vulnerability

CVE-2024-23496 is a heap-based buffer overflow in Ggerganov Llama.cpp that allows attackers to execute arbitrary code via malicious GGUF files. This article covers the technical details, affected versions, and mitigation.

Published: April 15, 2026

CVE-2024-23496 Overview

A heap-based buffer overflow vulnerability exists in the GGUF library gguf_fread_str functionality of llama.cpp. This vulnerability, identified in Commit 18c2e17, allows attackers to achieve code execution through a specially crafted .gguf file. The flaw resides in how the library processes string data when reading GGUF model files, enabling memory corruption that can be leveraged for arbitrary code execution.

Critical Impact

Remote code execution is possible when a user loads a malicious .gguf model file, potentially compromising systems running llama.cpp-based AI applications without any authentication requirements.

Affected Products

  • ggerganov llama.cpp (Commit 18c2e17 and potentially adjacent versions)

Discovery Timeline

  • 2024-02-26 - CVE-2024-23496 published to NVD
  • 2025-11-04 - Last updated in NVD database

Technical Details for CVE-2024-23496

Vulnerability Analysis

This vulnerability combines two critical weakness types: Integer Overflow (CWE-190) and Out-of-Bounds Write (CWE-787). The gguf_fread_str function in the GGUF library fails to properly validate string length values read from .gguf files before allocating heap memory and copying data. When processing a maliciously crafted file, an integer overflow can occur during size calculations, resulting in a smaller-than-expected buffer allocation. Subsequent data copying operations then overflow this undersized buffer, corrupting adjacent heap memory.

The network attack vector with no authentication requirements means that any application accepting .gguf files from untrusted sources—such as model sharing platforms or user uploads—is potentially vulnerable. The exploitation requires no user interaction beyond loading the malicious file, making it particularly dangerous in automated model processing pipelines.

Root Cause

The root cause is improper validation of string length fields within the GGUF file format parser. The gguf_fread_str function reads a length value from the file and uses it directly in memory allocation and copy operations without adequate bounds checking. An attacker can craft a .gguf file with a length field that causes an integer overflow when calculating the required buffer size, leading to a heap buffer that is too small for the actual data being read.

Attack Vector

The attack is executed by providing a malicious .gguf file to any application or service built on llama.cpp that processes model files. The attack flow involves:

  1. The attacker crafts a .gguf file containing a malformed string length field designed to trigger an integer overflow
  2. When the victim's application loads this file, the gguf_fread_str function allocates an undersized heap buffer
  3. The subsequent file read operation copies more data than the buffer can hold, overwriting adjacent heap metadata and data structures
  4. By carefully controlling the overflow data, the attacker can corrupt function pointers or other critical data to redirect execution flow and achieve arbitrary code execution

The vulnerability is described in detail in the Talos Intelligence Vulnerability Report.

Detection Methods for CVE-2024-23496

Indicators of Compromise

  • Unexpected crashes or segmentation faults in llama.cpp-based applications when loading .gguf files
  • Anomalous heap memory patterns or corruption detected by memory sanitizers
  • Suspicious .gguf files with abnormal string length fields or unusually large metadata sections

Detection Strategies

  • Implement file integrity monitoring for .gguf files entering the environment, comparing against known-good model hashes
  • Deploy memory corruption detection tools (AddressSanitizer, Valgrind) in development and staging environments to catch exploitation attempts
  • Monitor for unusual process behavior following model file loading, including unexpected child processes or network connections
  • Use application-level logging to track all .gguf file loading events with source attribution

Monitoring Recommendations

  • Enable crash dump collection and analysis for llama.cpp processes to identify potential exploitation attempts
  • Implement behavioral monitoring for processes that load .gguf files, alerting on anomalous post-load activities
  • Review and audit the provenance of all .gguf model files before deployment in production environments

How to Mitigate CVE-2024-23496

Immediate Actions Required

  • Update llama.cpp to a version released after Commit 18c2e17 that includes the security fix
  • Restrict processing of .gguf files to trusted sources only until patching is complete
  • Implement network segmentation to isolate systems running vulnerable llama.cpp instances
  • Review access controls for any services that accept user-supplied model files

Patch Information

Organizations should update llama.cpp to the latest available version from the official repository. The vulnerability was identified in Commit 18c2e17, so any commits addressing this issue will be subsequent to this version. Check the Talos Intelligence Advisory for specific patch commit references and additional remediation guidance.

Workarounds

  • Implement strict input validation at the application layer to reject .gguf files with suspicious characteristics before passing them to the library
  • Run llama.cpp applications in sandboxed environments (containers, VMs) with minimal privileges to limit the impact of successful exploitation
  • Deploy application-level firewalls or content filtering to scan uploaded model files before processing
  • Consider compiling llama.cpp with memory hardening options such as stack canaries, ASLR, and heap protection mechanisms

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechGgerganov Llama.cpp

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.15%

  • 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-190

  • CWE-787
  • Technical References
  • Talos Intelligence Vulnerability Report

  • Talos Intelligence Vulnerability Report
  • Related CVEs
  • CVE-2024-21802: Llama.cpp Buffer Overflow Vulnerability

  • CVE-2024-42479: Ggerganov Llama.cpp RCE 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