CVE-2026-72854: msgpack-c Integer Overflow in msgpack_unpacker_expand_buffer Causes a False-Success Undersized Reservation

Published Aug 20, 2026
·
Updated

msgpackunpackerexpandbuffer in src/unpack.c, reached through the public msgpackunpackerreservebuffer API, computes its new buffer size using an unchecked sizet 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 SIZEMAX 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/libbufferunpack.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.

Affected Software

1 affected component
msgpack-c

Event History

Aug 20, 2026
CVE Published
via MITRE·06:19 PM
Data Sourced
via MITRE·06:19 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which integrations are realistically exposed to this issue?

Exposure requires an application to call the public msgpack_unpacker_reserve_buffer API with an attacker-influenced requested length. A length-prefixed streaming transport is an example; msgpack-c's own decode entry points do not derive the reservation size from untrusted input.

2

What must happen for exploitation to lead to a heap overflow?

The requested reservation size must be near SIZE_MAX so that adding it to the currently used buffer size wraps. The API then reports success after allocating only the small pre-wrap size, and the caller must subsequently write the originally requested length into that undersized buffer.

3

Does a successful reservation call guarantee that the requested capacity is available?

No. Under the overflow condition, msgpack_unpacker_reserve_buffer can return true even though it did not reserve the requested capacity. The example's capacity-versus-request assert would detect this condition, but it is compiled out when NDEBUG is defined.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203