Read the docs

Integer truncation in Valkey cluster publish causes buffer overflow

Priority MEDIUM 53Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-f4q9-j22m-xqq9. Fix status from GitHub.

Summary

Valkey valkey-server releases up to and including 9.2.0-rc1, 9.1.2, 9.0.6, 8.1.10, 8.0.11 and 7.2.14 are affected when running in cluster mode. An integer truncation in the cluster message builder for PUBLISH and SPUBLISH allocates a buffer far smaller than the message, which is then overwritten. An authenticated user who can publish to a channel can crash the server and may be able to execute code as the user the server runs as.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

Description from the GitHub advisory

## Impact An authenticated user who can publish to a channel on a server running in cluster mode can make the server allocate a heap buffer far smaller than the message it is about to copy into it, and then write past the end of that buffer with attacker-controlled bytes. This reliably crashes the server process, and because the overflowing bytes are chosen by the attacker, it may be possible to escalate it to remote code execution running as the user the server runs as. This issue affects Valkey 7.2, 8.0, 8.1, 9.0, 9.1 and 9.2 running in cluster mode. Servers that do not have cluster mode enabled are not affected. ## Details When a node propagates a `PUBLISH` or `SPUBLISH` to the rest of the cluster, `clusterCreatePublishMsgBlock` in `src/cluster_legacy.c` (`src/cluster.c` on 7.2) computes the length of the cluster bus message as a `size_t`, but passes it to `createClusterMsgSendBlock`, which takes a `uint32_t`. When the channel and message together exceed `UINT32_MAX`, the length is silently truncated and a buffer far smaller than the message is allocated. The two `memcpy` calls that follow copy the full channel and message into it. Both the regular and the light cluster bus header paths are affected, as are the module publish APIs. Building a channel and message this large requires more than 4 GiB of memory. With the default `proto-max-bulk-len` of 512 MB, a client cannot send arguments that large directly, but a script can construct them on the server. The cluster bus cannot represent a message of this size, so the fix validates the complete serialized length before any 32-bit conversion or allocation. `PUBLISH` and `SPUBLISH` now reply with an error, and the message is neither published locally nor propagated. ## Mitigation You can mitigate this issue by using Valkey ACLs to restrict the scripting commands (`EVAL`, `EVALSHA`, `EVAL_RO`, `EVALSHA_RO`, `FCALL`, `FCALL_RO` and `FUNCTION`) if your application does not intend to use them, and by not raising `proto-max-bulk-len` above its default. ## Credits The defect was reported by Nenad Stojanovski working with Trend Micro Zero Day Initiative (ZDI-CAN-28318). The fix was authored by https://github.com/roshkhatri (#5030).

Why it matters now

Fix Fixed valkey-server: 9.2.0-rc2, 9.1.3, 9.0.7 +3

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—valkey-server<= 9.2.0-rc1, <= 9.1.2, <= 9.0.6, <= 8.1.10, <= 8.0.11, <= 7.2.149.2.0-rc2, 9.1.3, 9.0.7, 8.1.11, 8.0.12, 7.2.15Patch availableGHSA-f4q9-j22m-xqq9
  • valkey-server Vendor— Affected <= 9.2.0-rc1, <= 9.1.2, <= 9.0.6, <= 8.1.10, <= 8.0.11, <= 7.2.14 Fixed in 9.2.0-rc2, 9.1.3, 9.0.7, 8.1.11, 8.0.12, 7.2.15 Patch available GHSA-f4q9-j22m-xqq9

Remediation

Upgrade valkey-server to 9.2.0-rc2, 9.1.3, 9.0.7, 8.1.11, 8.0.12 or 7.2.15, depending on the release branch in use. Until then, restrict the scripting commands EVAL, EVALSHA, EVAL_RO, EVALSHA_RO, FCALL, FCALL_RO and FUNCTION with ACLs if the application does not use them, and keep proto-max-bulk-len at its default of 512 MB.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

  • Fix · GHSA-f4q9-j22m-xqq9 valkey-server Fixed in 9.2.0-rc2, 9.1.3, 9.0.7, 8.1.11, 8.0.12, 7.2.15 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-f4q9-j22m-xqq9

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences