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

CVE-2024-25176: LuaJIT Buffer Overflow Vulnerability

CVE-2024-25176 is a stack-buffer-overflow vulnerability in LuaJIT through version 2.1 that affects the lj_strfmt_wfnum function. This article covers technical details, affected versions, security impact, and mitigation.

Published: March 31, 2026

CVE-2024-25176 Overview

CVE-2024-25176 is a stack buffer overflow vulnerability affecting LuaJIT through version 2.1 and OpenResty luajit2 before version v2.1-20240626. The vulnerability exists in the lj_strfmt_wfnum function within lj_strfmt_num.c, which handles number formatting operations. This memory corruption flaw can be triggered through maliciously crafted input during string formatting operations, potentially leading to arbitrary code execution or system compromise.

Critical Impact

This stack buffer overflow vulnerability enables network-based attacks without authentication or user interaction, potentially allowing complete system compromise through arbitrary code execution.

Affected Products

  • LuaJIT through version 2.1
  • OpenResty luajit2 before v2.1-20240626
  • Applications and services embedding vulnerable LuaJIT versions

Discovery Timeline

  • 2025-07-07 - CVE-2024-25176 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2024-25176

Vulnerability Analysis

The vulnerability resides in the lj_strfmt_wfnum function responsible for formatting floating-point numbers during string operations. The flaw occurs in the zero stripping logic used by the %g number formatting specifier. When processing certain numeric values, the code fails to properly bound-check the ndlo index variable before using it to access the nd array buffer. This allows an attacker to craft input that causes the index to exceed the array bounds, resulting in a stack buffer overflow condition.

The vulnerability can be exploited remotely through any application that processes untrusted Lua scripts or passes untrusted data to string formatting functions. Since LuaJIT is commonly embedded in web servers (like OpenResty/nginx), game engines, and other network-facing applications, the attack surface is significant.

Root Cause

The root cause is an improper array index increment in the lj_strfmt_wfnum function. The original code used nd[++ndlo] to increment and access the next element in the digit array during zero stripping. This pre-increment operation could cause ndlo to exceed the valid array bounds when certain numeric patterns are processed. The fix applies a bitmask (& 0x3f) to constrain the index to valid array bounds before accessing the buffer.

Attack Vector

The vulnerability is exploitable over the network without requiring authentication or user interaction. Attackers can trigger the overflow by:

  1. Submitting maliciously crafted numeric values to applications using LuaJIT's string formatting functions
  2. Exploiting web applications built on OpenResty that process user-controlled numeric input
  3. Targeting any service that evaluates untrusted Lua scripts using vulnerable LuaJIT versions
c
// Security patch demonstrating the fix
// Source: https://github.com/LuaJIT/LuaJIT/commit/343ce0edaf3906a62022936175b2f5410024cbfc

 	    prec--;
 	    if (!i) {
 	      if (ndlo == ndhi) { prec = 0; break; }
-	      lj_strfmt_wuint9(tail, nd[++ndlo]);
+	      ndlo = (ndlo + 1) & 0x3f;
+	      lj_strfmt_wuint9(tail, nd[ndlo]);
 	      i = 9;
 	    }
 	  }

The patch replaces the unbounded pre-increment ++ndlo with a bounded operation (ndlo + 1) & 0x3f, ensuring the index never exceeds 63 (0x3f), which prevents the buffer overflow.

Detection Methods for CVE-2024-25176

Indicators of Compromise

  • Unexpected crashes or segmentation faults in LuaJIT-based applications during string formatting operations
  • Abnormal memory access patterns or stack corruption indicators in application logs
  • Evidence of exploitation attempts through malformed numeric values in web request logs
  • Core dumps showing corruption in lj_strfmt_num.c related stack frames

Detection Strategies

  • Deploy memory safety monitoring tools to detect stack buffer overflow attempts in LuaJIT processes
  • Implement application-level logging for string formatting operations with anomalous numeric inputs
  • Use SentinelOne's behavioral AI to detect exploitation attempts targeting memory corruption vulnerabilities
  • Monitor for unusual process behavior in applications using LuaJIT, including unexpected memory allocation patterns

Monitoring Recommendations

  • Enable AddressSanitizer (ASan) in development and staging environments to detect memory corruption
  • Configure SentinelOne Singularity to monitor LuaJIT-based applications for exploitation indicators
  • Implement network-level monitoring for requests containing unusually formatted numeric values
  • Review application logs for patterns consistent with fuzzing or exploitation attempts against formatting functions

How to Mitigate CVE-2024-25176

Immediate Actions Required

  • Update LuaJIT to a version containing commit 343ce0edaf3906a62022936175b2f5410024cbfc or later
  • Update OpenResty luajit2 to version v2.1-20240626 or later
  • Identify all applications in your environment using LuaJIT and prioritize patching based on network exposure
  • Apply vendor patches from Debian LTS or other distribution-specific security updates

Patch Information

The vulnerability has been addressed through official commits to both LuaJIT and OpenResty luajit2 repositories. The fix modifies the index increment operation in lj_strfmt_wfnum to apply proper bounds checking using a bitmask operation. Organizations should apply the patch from the LuaJIT GitHub Commit or update to patched distribution packages. Debian users can refer to the Debian LTS Announcement for package updates.

Workarounds

  • Restrict network access to LuaJIT-based applications until patching is complete
  • Implement input validation to sanitize numeric values before passing them to string formatting functions
  • Deploy web application firewall rules to filter potentially malicious numeric input patterns
  • Isolate LuaJIT processes using containerization or sandboxing to limit impact of potential exploitation
bash
# Configuration example: Verify LuaJIT version and check for vulnerability
# Check current LuaJIT version
luajit -v

# Verify if the patch commit is present in your installation
# The fix should include the bounded index operation: (ndlo + 1) & 0x3f
grep -r "0x3f" /usr/local/share/luajit*/lj_strfmt_num.c 2>/dev/null || echo "Check source installation"

# For OpenResty installations, verify luajit2 version
# Ensure version is v2.1-20240626 or later

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLuajit

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.17%

  • 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-121
  • Technical References
  • GitHub Gist PoC

  • GitHub LuaJIT Issue

  • GitHub OpenResty Commit

  • Debian LTS Announcement
  • Vendor Resources
  • GitHub LuaJIT Commit
  • Related CVEs
  • CVE-2024-25178: LuaJIT Buffer Overflow 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