{"id":"CVE-2026-72854","state":"PUBLISHED","title":"msgpack-c Integer Overflow in msgpack_unpacker_expand_buffer Causes a False-Success Undersized Reservation","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.","publishedAt":"2026-08-20T18:19:24.266Z","updatedAt":"2026-09-24T14:19:03.146Z","severity":{"score":5.8,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","source":"VulnCheck"},"assigner":"VulnCheck","products":["msgpack msgpack-c"],"affected":[{"vendor":"msgpack","product":"msgpack-c","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"7.0.1","versionType":"custom"}],"repo":"https://github.com/msgpack/msgpack-c"}],"references":["https://github.com/msgpack/msgpack-c/issues/1181","https://github.com/msgpack/msgpack-c/blob/c-7.0.1/src/unpack.c#L429-L502","https://github.com/msgpack/msgpack-c/blob/c-7.0.1/include/msgpack/unpack.h#L219-L223","https://github.com/msgpack/msgpack-c/blob/c-7.0.1/example/lib_buffer_unpack.c","https://github.com/msgpack/msgpack-c","https://www.vulncheck.com/advisories/msgpack-c-integer-overflow-in-msgpack-unpacker-expand-buffer-causes-a-false-success-undersized-reservation"],"weaknesses":["CWE-190","CWE-787"],"ingestedAt":"2026-10-29T20:12:58.252Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/72xxx/CVE-2026-72854.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-72854","state":"PUBLISHED","datePublished":"2026-08-20T18:19:24.266Z","dateUpdated":"2026-09-24T14:19:03.146Z","assignerShortName":"VulnCheck","assignerOrgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateReserved":"2026-08-10T15:16:31.371Z"},"containers":{"cna":{"title":"msgpack-c Integer Overflow in msgpack_unpacker_expand_buffer Causes a False-Success Undersized Reservation","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"msgpack","product":"msgpack-c","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"7.0.1","versionType":"custom"}],"repo":"https://github.com/msgpack/msgpack-c"}],"references":[{"url":"https://github.com/msgpack/msgpack-c/issues/1181","tags":["issue-tracking"],"name":"GitHub Issue #1181"},{"url":"https://github.com/msgpack/msgpack-c/blob/c-7.0.1/src/unpack.c#L429-L502","tags":["technical-description"],"name":"msgpack_unpacker_expand_buffer at c-7.0.1"},{"url":"https://github.com/msgpack/msgpack-c/blob/c-7.0.1/include/msgpack/unpack.h#L219-L223","tags":["technical-description"],"name":"msgpack_unpacker_reserve_buffer capacity contract at c-7.0.1"},{"url":"https://github.com/msgpack/msgpack-c/blob/c-7.0.1/example/lib_buffer_unpack.c","tags":["technical-description"],"name":"Shipped example demonstrating the reserve-then-write pattern"},{"url":"https://github.com/msgpack/msgpack-c","tags":["product"]},{"url":"https://www.vulncheck.com/advisories/msgpack-c-integer-overflow-in-msgpack-unpacker-expand-buffer-causes-a-false-success-undersized-reservation","name":"VulnCheck Advisory: msgpack-c Integer Overflow in msgpack_unpacker_expand_buffer Causes a False-Success Undersized Reservation","tags":["third-party-advisory"]}],"metrics":[{"format":"CVSS","cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"HIGH","availabilityImpact":"LOW","baseScore":5.3,"baseSeverity":"MEDIUM"}},{"format":"CVSS","cvssV4_0":{"version":"4.0","vectorString":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","attackVector":"LOCAL","attackComplexity":"HIGH","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","vulnAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":5.8,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-190","lang":"en","description":"Integer Overflow or Wraparound","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-787","lang":"en","description":"Out-of-bounds Write","type":"CWE"}]}],"providerMetadata":{"shortName":"VulnCheck","orgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateUpdated":"2026-09-24T14:19:03.146Z"},"datePublic":"2026-08-13T00:00:00.000Z","credits":[{"lang":"en","value":"mtholmquist","type":"finder"}],"x_generator":{"engine":"vulncheck-endgame"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/msgpack/msgpack-c/issues/1181","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-20T18:52:52.984726Z","id":"CVE-2026-72854","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-20T18:53:26.891Z"}}]}}}