Critical Stack Buffer Overflow in LuaJIT Package

luajit Updated 02 Oct 2025

Summary

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

ALPINE-CVE-2024-25176: LuaJIT through 2.1 and OpenRusty luajit2 before v2.1-20240626 have a stack-buffer-overflow in lj_strfmt_wfnum in lj_strfmt_num.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 for applications requiring high-speed execution of Lua scripts. However, vulnerabilities in LuaJIT can lead to severe security risks, including arbitrary code execution and system crashes.

Vulnerability Detail

The vulnerability identified as ALPINE-CVE-2024-25176 affects LuaJIT versions through 2.1 and OpenRusty luajit2 before v2.1-20240626. It is characterized by a stack-buffer overflow in the function lj_strfmt_wfnum located in lj_strfmt_num.c. This flaw can be exploited by an attacker to execute arbitrary code, potentially compromising the integrity and confidentiality of the system running the affected software.

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 measure, if upgrading is not immediately feasible, consider restricting access to the application using LuaJIT or implementing additional security layers to mitigate potential exploitation of this vulnerability.

Conclusion

The vulnerability ALPINE-CVE-2024-25176 poses a significant risk to systems using affected versions of LuaJIT. It is crucial to update to the patched version to mitigate potential exploitation. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for luajit →

Share this vulnerability

FAQ

A stack buffer overflow occurs when data exceeds the allocated buffer space on the stack, potentially overwriting adjacent memory and leading to unpredictable behavior or security vulnerabilities.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By simply providing a manifest file like package-lock.json, you can check for vulnerabilities without needing to access the code.

Exploiting this vulnerability can allow attackers to execute arbitrary code, which may lead to data breaches, system crashes, or unauthorized access to sensitive information.

Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If immediate upgrading is not possible, consider implementing security measures such as restricting access to the application or using alternative libraries until the upgrade can be performed.

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