All vulnerabilities

Servers and applications

GHSA-fq2f-crmw-q97r

Unauthenticated use-after-free of the Lua interpreter state in Valkey (script debugger command cache)

Severity
High 8.8
Published
31 Aug 2026
Last changed
31 Aug 2026
Added to UpHeron
3 Nov 2026
Fixed in
9.1.2
Weakness
Use after free (CWE-416)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Sources
Project advisories (GitHub)

Description

An attacker who can run scripting commands can free the Lua interpreter state out from under the script debugger's cached command table, leaving a dangling pointer that is dereferenced on the next debugger command. This yields a reliable crash of the server process, and can be escalated to control of an indirect call by reclaiming the freed heap chunk with attacker-controlled bytes.

This issue affects the 9.x line. The defect was introduced when the Lua scripting engine was moved into a Valkey module. The 8.0.x and 8.1.x lines use the previous non-module debugger and are not affected.

ldbGenerateDebuggerCommandsArray in src/modules/lua/debug_lua.c builds the interactive debugger command table once and caches it in a file-scope static, binding the then-current lua_State pointer into each command descriptor's context field. The table is never rebuilt or invalidated.

From valkey-io/valkey's security advisory. Shortened; the full text is there.

Workarounds

You can mitigate this issue by using Valkey ACLs to restrict the SCRIPT command, in particular SCRIPT DEBUG, if your application doesn't intend to use the script debugger.

Workarounds as given by valkey-io/valkey's security advisory.

Affected software

SoftwareAffected versions
ValkeyServers and applications · github:valkey-io/valkey
  • Every version before 9.1.2

About Valkey

NoSQL database management software forked from Redis

From Wikidata, CC0 1.0.
Developers who used it in the past year
2.4%Stack Overflow Developer Survey 2025, 2025
Docker Hub pulls
404,291,684Docker Hub, 15 Nov 2026
GitHub stars
27,721GitHub, 15 Nov 2026
Forks
1,535GitHub, 15 Nov 2026
Latest release
9.1.3GitHub, 15 Nov 2026
Released
26 Oct 2026GitHub
License
3-clause BSD LicenseWikidata
Written in
CWikidata
First released
28 Mar 2024Wikidata
First published on GitHub
22 Mar 2024GitHub

Release lines

ReleaseLatestSecurity fixes
9.19.1.3Until 19 May 2031
9.09.0.7Until 21 Oct 2028
8.18.1.11Until 31 Mar 2030
8.08.0.12Until 15 Sept 2027
7.27.2.15Until 16 Apr 2029

From endoflife.date.

References