Critical Out-of-Bounds Read Vulnerability in LuaJIT Package

luajit Updated 02 Oct 2025

Summary

07/07/2025
N/A
Yes i
Unrated
Not published

ALPINE-CVE-2024-25178: LuaJIT through 2.1 and OpenRusty luajit2 before v2.1-20240314 have an out-of-bounds read in the stack-overflow handler in lj_state.c. Affects luajit versions < 2.1_p20240815-r1. Fixed in 2.1_p20240815-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

LuaJIT is a Just-In-Time Compiler for the Lua programming language, designed to enhance performance by compiling Lua code into machine code. It is widely used in various applications for its speed and efficiency. However, it has recently been discovered that LuaJIT versions up to 2.1 and OpenRusty luajit2 before v2.1-20240314 are susceptible to an out-of-bounds read vulnerability, which can lead to potential security risks.

Vulnerability Detail

The vulnerability arises from an out-of-bounds read in the stack-overflow handler located in lj_state.c. This flaw can be exploited by attackers to read memory locations that they should not have access to, potentially leading to information disclosure or application crashes. The issue affects multiple versions of the LuaJIT package across various Alpine Linux distributions, making it critical for users to address it promptly.

How To Fix

Minimum fixed version

2.1_p20240815-r1

This is the first release that contains the fix.

sudo apk add --upgrade luajit

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using the affected versions of LuaJIT until they can apply the patch. Additionally, consider using alternative Lua implementations that do not exhibit this vulnerability.

Conclusion

The out-of-bounds read vulnerability in LuaJIT poses significant risks to applications utilizing this package. It is crucial for users to update to the patched version to safeguard their systems. By staying informed and utilizing tools like Vulert, developers can effectively manage and mitigate vulnerabilities in their software.

See every vulnerability recorded for luajit →

Share this vulnerability

FAQ

LuaJIT is a Just-In-Time Compiler for the Lua programming language, enhancing its performance by compiling Lua code into machine code.

It allows attackers to read memory locations outside the intended bounds, potentially leading to information disclosure or application crashes.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Update the LuaJIT package to version 2.1_p20240815-r1 using the command 'apk add luajit=2.1_p20240815-r1' to mitigate the vulnerability.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for luajit.

How To Fix

Minimum fixed version

2.1_p20240815-r1

This is the first release that contains the fix.

sudo apk add --upgrade luajit

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback