Use After Free Affecting lua package, versions [,5.4.4)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.99% (58th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-CONAN-LUA-10077606
  • published8 May 2025
  • disclosed17 Mar 2022
  • creditUnknown

Introduced: 17 Mar 2022

CVE-2021-44964  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade lua to version 5.4.4 or higher.

Overview

Affected versions of this package are vulnerable to Use After Free by exploiting a use after free vulnerability in the garbage collector and finalizer of lgc.c in the Lua interpreter, allowing the escape by using a crafted script file. The script file uses the use after free vulnerability to allow tcache bin poisoning which can change the address of the next chunk in tcache bin. With that, a chunk at __free_hook is being allocated and the address of the system function is written in it, leading to a /bin/sh shell.

CVSS Base Scores

version 3.1