Valkey clusterCreatePublishMsgBlock Numeric Truncation Error Remote Code Execution Vulnerability
The PUBLISH message handler in Valkey did not properly validate user-supplied parameters, leading to an incorrect size calculation before a buffer was allocated. An authenticated remote attacker could exploit this to execute arbitrary code as the service account.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of Valkey. Authentication is required to exploit this vulnerability.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an integer truncation in the size calculation for the PUBLISH handler, so a buffer was allocated smaller than the data later written into it.
Impact
An authenticated attacker could execute arbitrary code in the context of the service account.
What the attacker needed
Valid credentials for the service
The fix
The vendor issued an update to correct the vulnerability.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Valkey is a data store that speaks a network protocol, and one of its commands is PUBLISH, used to send messages to subscribers. The program worked out how much memory to reserve for a message using numbers supplied by the client, but it did not check those numbers properly, so the calculation came out wrong. A logged-in attacker could then send crafted input that overflows that memory and runs their own code on the server.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.