Valkey JSON remote code execution in array mutation commands
- Exploited
- No known exploitation
- Fix
- Fixed in 1.0.3
- Who is exposed
- Specific setups only
Summary
Valkey JSON has a use-after-free flaw in its array mutation commands when they are given a recursive JSONPath expression. A user on the network who has logged in and can run these commands can crash the server, and the flaw has been developed into remote code execution as the user the server runs as.
Written by a model
Original description
In Valkey JSON 1.0.0 through 1.0.2, a recursive JSONPath expression such as $..* returns both an array and elements nested inside it. The size-changing mutators (JSON.ARRAPPEND, JSON.ARRINSERT, JSON.ARRPOP, JSON.ARRTRIM and JSON.CLEAR) process the ancestor first, which can reallocate its element buffer and free the old storage while the descendant entries in the result set still point into it; the module then writes through those dangling pointers. An authenticated user who can run these commands can use this to reliably crash the server, and it has been developed into remote code execution as the user the server runs as. Servers that do not load the JSON module, including through valkey-bundle, are not affected.
What to do
Upgrade to a fixed version: 1.0.3.
Workaround: Use Valkey ACLs to restrict JSON.ARRAPPEND, JSON.ARRINSERT, JSON.ARRPOP, JSON.ARRTRIM and JSON.CLEAR if the application does not use them.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-136158 (Valkey JSON: Use-after-free in array mutation commands through a recursive JSONPath), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-136158 (entry last updated 2026-11-24):
Affected:
- Valkey Valkey JSON: from 1.0.0, fixed in 1.0.3
Fixed versions: 1.0.3.
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: network access, low-privilege login, no user action.
Workaround: Use Valkey ACLs to restrict JSON.ARRAPPEND, JSON.ARRINSERT, JSON.ARRPOP, JSON.ARRTRIM and JSON.CLEAR if the application does not use them. (source: https://www.cve.org/CVERecord?id=CVE-2026-136158)
CISA KEV: CVE-2026-136158 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-136158 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/valkey-io/valkey-json/security/advisories/GHSA-q7rf-74qm-hr9g
- https://github.com/valkey-io/valkey-json/pull/118
- https://github.com/valkey-io/valkey-json/pull/120
- https://www.cve.org/CVERecord?id=CVE-2026-136158
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-136158
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-136158"}.Affected versions
- Valkey Valkey JSONFrom 1.0.0 · fixed in 1.0.3
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure8/25Specific setups only, reachable over the network
- Reach?/20Unknown. No tracked technology or package matched
- Severity8.8/10CVSS 8.8
- No patch0/5No signal
What would change the score
- Would score about 67 if added to CISA KEV
- Would score about 62 if CISA's SSVC rates exploitation active
- Would score about 24 if CISA's SSVC rates it automatable
Timeline
- CVE published
- First seen by cve.now
Evidence 5
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · valkey-io/valkey-json · Advisory GHSA-q7rf-74qm-hr9g |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-136158 |
| Record | NVD · CVE-2026-136158 |
| Other links 2 | |
| Repository | GitHub · valkey-io/valkey-json · Pull request #118 |
| Repository | GitHub · valkey-io/valkey-json · Pull request #120 |
Questions about CVE-2026-136158
Is CVE-2026-136158 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
A use-after-free bug in the array mutation commands (JSON.ARRAPPEND, JSON.ARRINSERT, JSON.ARRPOP, JSON.ARRTRIM and JSON.CLEAR) when they are reached through a recursive JSONPath. The advisory says an authenticated user can crash the server, and that the bug has been developed into remote code execution as the user the server runs as.
Source: github.com, cve.org
Which versions are affected by CVE-2026-136158?
Valkey JSON: from 1.0.0 before 1.0.3.
Source: cve.now feed data
Am I affected, and how do I check?
Valkey JSON versions from 1.0.0 up to but not including 1.0.3 are affected. To check, look at the Valkey JSON module version loaded by the server, which is the version the bundled or installed module reports.
Source: github.com, cve.org
How do I fix CVE-2026-136158?
Upgrade Valkey JSON to 1.0.3 or later, or move to a valkey-bundle release that ships it.
Source: github.com, cve.org
Related
- CVE-2026-136156Valkey: Integer truncation in cluster publish message construction causes a heap buffer overflow
- CVE-2026-136155Valkey: Use-after-free of the Lua interpreter state through the script debugger's command cache
- CVE-2026-136157Valkey: Use-after-free in the RDMA transport when a client is freed while pending data is processed
- CVE-2026-130822Valkey: Use-after-free when client eviction frees the client whose command is still executing
- CVE-2025-49112setDeferredReply in networking.c in Valkey through 8.1.1 has an integer underflow for prev->size - prev->used.
- CVE-2026-135597Sandbox escape due to use-after-free in the DOM: Navigation component
No corrections so far. Something wrong on this page? Report an error.