CVE-2026-72854: Integer Overflow or Wraparound in msgpack msgpack-c
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.
AI Analysis
Technical Summary
The vulnerability in msgpack-c (CVE-2026-72854) arises from an unchecked size_t addition in the msgpack_unpacker_expand_buffer function, which is called through the public msgpack_unpacker_reserve_buffer API. Although the doubling loop protects against multiplication overflow, the addition in the loop condition is unguarded, allowing a request size near SIZE_MAX to wrap around. This causes the function to allocate a smaller buffer than requested but still return success, misleading the caller. Subsequent writes of the requested length overflow the heap buffer. The library's own example demonstrates the reserve-then-write pattern, but defensive asserts are disabled under NDEBUG. Exploitation requires an integration that passes attacker-influenced length values to the reservation API, such as length-prefixed streaming transports. The vulnerability affects msgpack-c versions up to 7.0.1. No vendor advisory or patch information is currently available.
Potential Impact
A heap buffer overflow can occur if an attacker controls the length parameter passed to the msgpack_unpacker_reserve_buffer API, potentially leading to memory corruption. The CVSS score of 5.3 reflects a medium severity with local attack vector, high attack complexity, no privileges required, and user interaction needed. The impact includes integrity and availability loss but no confidentiality impact is indicated. Exploitation requires specific integration conditions and is not directly exploitable via msgpack-c's own decode entry points.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid passing untrusted or attacker-controlled length values to the msgpack_unpacker_reserve_buffer API. Review integrations that use length-prefixed streaming transports or similar mechanisms to ensure they do not expose this vulnerability.
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
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 in msgpack-c (CVE-2026-72854) arises from an unchecked size_t addition in the msgpack_unpacker_expand_buffer function, which is called through the public msgpack_unpacker_reserve_buffer API. Although the doubling loop protects against multiplication overflow, the addition in the loop condition is unguarded, allowing a request size near SIZE_MAX to wrap around. This causes the function to allocate a smaller buffer than requested but still return success, misleading the caller. Subsequent writes of the requested length overflow the heap buffer. The library's own example demonstrates the reserve-then-write pattern, but defensive asserts are disabled under NDEBUG. Exploitation requires an integration that passes attacker-influenced length values to the reservation API, such as length-prefixed streaming transports. The vulnerability affects msgpack-c versions up to 7.0.1. No vendor advisory or patch information is currently available.
Potential Impact
A heap buffer overflow can occur if an attacker controls the length parameter passed to the msgpack_unpacker_reserve_buffer API, potentially leading to memory corruption. The CVSS score of 5.3 reflects a medium severity with local attack vector, high attack complexity, no privileges required, and user interaction needed. The impact includes integrity and availability loss but no confidentiality impact is indicated. Exploitation requires specific integration conditions and is not directly exploitable via msgpack-c's own decode entry points.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid passing untrusted or attacker-controlled length values to the msgpack_unpacker_reserve_buffer API. Review integrations that use length-prefixed streaming transports or similar mechanisms to ensure they do not expose this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-10T15:16:31.371Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a874977acd9273b49fe8a0f
Added to database: 08/20/2026, 18:37:43 UTC
Last enriched: 08/20/2026, 18:52:16 UTC
Last updated: 08/20/2026, 19:55:23 UTC
Views: 7
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.