Valkey: Use-after-free of the Lua interpreter state through the script debugger's command cache
Summary
| CVE | CVE-2026-136155 |
|---|---|
| State | PUBLISHED |
| Assigner | Akrites |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-11-24 15:17:33 UTC |
| Updated | 2026-11-24 15:19:53 UTC |
| Description | In Valkey 9.1.0 and 9.1.1, the Lua script debugger builds its command table once and caches it with a pointer to the Lua interpreter state that was current at the time. SCRIPT FLUSH ASYNC recreates the scripting engine and frees the previous interpreter state without invalidating that cache, so the next debugger command dereferences freed memory. An authenticated user who can run scripting commands can use this to reliably crash the server, and by reclaiming the freed heap chunk with attacker-controlled bytes can escalate it to control of an indirect call, which may lead to remote code execution. The fix also addresses a second use-after-free in ldbLogStackValue. Valkey 8.0.x and 8.1.x use the previous debugger and are not affected. |
Risk And Classification
Primary CVSS: v3.1 8.8 HIGH from 7fefd608-56a6-419f-a002-fd8543c0710a
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Problem Types: CWE-416 | CWE-416 CWE-416 Use After Free
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | 7fefd608-56a6-419f-a002-fd8543c0710a | Secondary | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| 3.1 | CNA | CVSS | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
LowUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| github.com/valkey-io/valkey/security/advisories/GHSA-fq2f-crmw-q97r | 7fefd608-56a6-419f-a002-fd8543c0710a | github.com | |
| github.com/valkey-io/valkey/pull/4574 | 7fefd608-56a6-419f-a002-fd8543c0710a | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Trung Nguyen of CyStack (en)
CNA: Phuc Nguyen Dinh of CyStack (en)
CNA: Han Sang-Kyung (en)
CNA: Bara' Hasheesh (en)
Additional Advisory Data
Solutions
CNA: Upgrade to Valkey 9.1.2 or later.
Workarounds
CNA: Use Valkey ACLs to restrict the SCRIPT command, in particular SCRIPT DEBUG, if your application does not use the script debugger.
There are currently no legacy QID mappings associated with this CVE.