Tarantool Msgpuck mp_check Denial Of Service Vulnerability
The mp_check function in Msgpuck 1.0.3 incorrectly returns success when validating a map16 packet that would read beyond the buffer, due to a typo returning false instead of 1. An attacker can send a crafted MsgPack packet to cause an out-of-bounds read, leading to a denial of service.
Originally disclosed on Cisco Talos
An exploitable incorrect return value vulnerability exists in the mpcheck function of Tarantool’s Msgpuck library 1.0.3. A specially crafted packet can cause the mpcheck function to incorrectly return success when trying to check if decoding a map16 packet will read outside the bounds of a buffer, resulting in a…
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 a typo in the mp_check function: for map16, the bounds check returns false (0) instead of 1, so the function incorrectly reports success.
Impact
A remote attacker could cause a denial of service by crashing the application that uses the vulnerable library.
What the attacker needed
Application uses Msgpuck 1.0.3; attacker can send MsgPack data
The fix
The typo should be corrected so that the bounds check returns 1 on failure, as it does for map32.
How it was found
- Compile the provided server that reads MsgPack data and uses a guard page.
- Run the server on a chosen host and port.
- Send a series of packets: valid fixmap, map16, map32, then an invalid map16, and finally a vulnerable map16.
- The vulnerable map16 packet triggers an out-of-bounds read, causing a crash.
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.
Msgpuck is a library for reading and writing data in a compact format called MsgPack. Before decoding, it checks that the data is valid and won't read past the end of the buffer. A mistake in that check for one data type lets a malformed packet slip through, and when the library later tries to decode it, it reads memory it shouldn't, which can crash the program.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.