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

CVE-2024-25178: LuaJIT Buffer Overflow Vulnerability

CVE-2024-25178 is a buffer overflow flaw in LuaJIT through version 2.1 that causes an out-of-bounds read in the stack-overflow handler. This article covers technical details, affected versions, impact, and mitigation.

Published: April 8, 2026

CVE-2024-25178 Overview

CVE-2024-25178 is an out-of-bounds read vulnerability affecting LuaJIT through version 2.1 and OpenResty luajit2 before v2.1-20240314. The flaw exists in the stack-overflow handler within lj_state.c, where improper boundary checks can lead to reading memory outside allocated buffers when processing stack overflow conditions.

Critical Impact

This vulnerability can be exploited remotely without authentication to cause information disclosure or denial of service, potentially exposing sensitive memory contents or crashing applications that embed LuaJIT.

Affected Products

  • LuaJIT through version 2.1
  • OpenResty luajit2 versions prior to v2.1-20240314
  • Applications and services embedding vulnerable LuaJIT versions

Discovery Timeline

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

Technical Details for CVE-2024-25178

Vulnerability Analysis

This vulnerability is classified as CWE-125 (Out-of-Bounds Read), a memory safety issue that occurs when software reads data from a location that is outside the bounds of the intended buffer. In the context of LuaJIT, this flaw manifests specifically within the stack-overflow handler implementation in lj_state.c.

When LuaJIT encounters a stack overflow condition, the handler attempts to manage the error gracefully. However, due to insufficient boundary validation, the handler can read memory beyond the allocated stack boundaries. This can result in information disclosure if sensitive data resides in adjacent memory regions, or trigger application crashes leading to denial of service.

The network attack vector indicates that this vulnerability can be triggered remotely, potentially through crafted Lua scripts or inputs processed by applications embedding LuaJIT. The absence of required privileges or user interaction makes this vulnerability particularly dangerous for internet-facing services using OpenResty, nginx with Lua modules, or other LuaJIT-embedded applications.

Root Cause

The root cause lies in inadequate bounds checking within the stack-overflow handler in lj_state.c. When the Lua VM detects a stack overflow condition, the error handling code fails to properly validate memory access boundaries before reading stack data. This allows reads to extend beyond the legitimate stack memory region into adjacent memory areas.

The fix, implemented in commit defe61a56751a0db5f00ff3ab7b8f45436ba74c8, addresses this by adding proper boundary validation to ensure all memory reads during stack-overflow handling remain within allocated bounds.

Attack Vector

An attacker can exploit this vulnerability by crafting malicious Lua scripts or inputs designed to trigger stack overflow conditions in a controlled manner. When the vulnerable stack-overflow handler processes these conditions, it may read beyond allocated memory boundaries.

The attack scenario involves:

  1. Identifying an application using a vulnerable LuaJIT version that processes external Lua input
  2. Crafting input that triggers deep recursion or stack exhaustion
  3. Exploiting the out-of-bounds read in the error handler to leak memory contents or crash the application

Technical details and a proof of concept are available in the GitHub Gist PoC and the GitHub Issue Discussion.

Detection Methods for CVE-2024-25178

Indicators of Compromise

  • Unexpected crashes or segmentation faults in LuaJIT-embedded applications during Lua script execution
  • Abnormal memory access patterns in processes running LuaJIT
  • Stack overflow errors followed by application instability or crashes
  • Unusual Lua scripts with deeply nested recursive function calls

Detection Strategies

  • Monitor for segmentation faults and memory access violations in processes using LuaJIT
  • Implement runtime application self-protection (RASP) to detect out-of-bounds memory access attempts
  • Use AddressSanitizer (ASan) in development and testing environments to identify out-of-bounds reads
  • Review application logs for repeated stack overflow errors that may indicate exploitation attempts

Monitoring Recommendations

  • Enable enhanced logging for Lua script execution errors and stack overflow events
  • Configure crash reporting to capture and analyze segmentation faults in LuaJIT processes
  • Monitor network traffic for suspicious patterns targeting LuaJIT-embedded web services
  • Implement application performance monitoring to detect unusual memory consumption or crashes

How to Mitigate CVE-2024-25178

Immediate Actions Required

  • Update LuaJIT to the latest version containing commit defe61a56751a0db5f00ff3ab7b8f45436ba74c8
  • Update OpenResty luajit2 to version v2.1-20240314 or later
  • Review and restrict untrusted Lua script execution in production environments
  • Implement input validation for any external data processed by Lua scripts

Patch Information

The vulnerability has been patched in the official LuaJIT repository. The fix is available in commit defe61a56751a0db5f00ff3ab7b8f45436ba74c8. OpenResty has also applied the same fix to their luajit2 fork, available in the OpenResty LuaJIT Commit.

Debian users should refer to the Debian LTS Announcement for distribution-specific patching guidance.

Workarounds

  • Limit Lua stack size using LUA_MAXSTACK configuration to reduce stack overflow attack surface
  • Implement sandboxing for Lua script execution to contain potential exploitation
  • Restrict network access to services processing untrusted Lua scripts
  • Use process isolation and containerization to limit the impact of potential memory disclosure
bash
# Configuration example - Limit Lua recursion depth in OpenResty
# Add to nginx.conf http/server block
lua_max_running_timers 256;
lua_max_pending_timers 1024;

# Consider implementing script execution timeouts
lua_socket_read_timeout 5s;

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.1

  • EPSS Probability0.19%

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

  • GitHub Issue Discussion

  • OpenResty LuaJIT Commit

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