CVE-2026-72854: Integer Overflow or Wraparound in msgpack msgpack-c
Description
msgpack_unpacker_expand_buffer in src/unpack.c, reached through the public msgpack_unpacker_reserve_buffer API, computes its new buffer size using an unchecked size_t addition of the requested size and the amount already used. The doubling loop guards its own multiplication against overflow, but the addition in the loop condition is unguarded, so a request near SIZE_MAX wraps: the loop condition is already satisfied, the allocation is performed at the small pre-wrap size, and the function returns true. The caller is told the requested capacity was reserved when it was not, so a subsequent write of the requested length overflows the heap buffer. The library's own example/lib_buffer_unpack.c demonstrates the reserve-then-write pattern, and its defensive assert comparing capacity against the request is compiled out under NDEBUG. msgpack-c's own decode entry points do not derive the reservation size from untrusted input, so reaching this requires an integration that passes an attacker-influenced length to the reservation API, such as a length-prefixed streaming transport.
CVSS v3.1
Score 5.3medium
Affected software
msgpack
msgpack-c
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in msgpack_unpacker_expand_buffer in src/unpack.c, accessed via the public API msgpack_unpacker_reserve_buffer. The function computes the new buffer size by adding the requested size to the amount already used without proper overflow checks. Although the doubling loop guards multiplication overflow, the addition in the loop condition is unchecked, allowing a wraparound near SIZE_MAX. This results in allocation of a smaller buffer than requested, but the function returns success. Subsequent writes overflow the heap buffer. The vulnerability requires an integration scenario where attacker-influenced lengths are passed to the reservation API, such as length-prefixed streaming transports. The library's own decode entry points do not expose this risk directly.
Potential Impact
Successful exploitation can cause a heap buffer overflow leading to integrity violations and potential denial of service. The CVSS score is 5.3 (medium severity) with impact on integrity and availability. There is no indication of confidentiality impact. Exploitation requires local access or a high attack complexity with no privileges and user interaction.
Mitigation Recommendations
No official patch or fix information is provided in the available data. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted or attacker-controlled length values to the msgpack_unpacker_reserve_buffer API. Use msgpack-c's decode entry points as intended, which do not derive reservation sizes from untrusted input.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-10T15:16:31.371Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a874977acd9273b49fe8a0f
Added to database: 08/20/2026, 18:37:43 UTC
Last enriched: 09/25/2026, 02:39:48 UTC
Last updated: 10/05/2026, 06:48:18 UTC
Views: 62
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.