{"id":"UBUNTU-CVE-2026-72854","details":"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.","modified":"2026-09-02T19:42:04.062081543Z","published":"2026-08-20T19:17:00Z","upstream":["CVE-2026-72854"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-72854"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-72854"}],"affected":[{"package":{"name":"msgpack-c","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/msgpack-c?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.1.5-1"],"ecosystem_specific":{"binaries":[{"binary_name":"libmsgpackc2","binary_version":"2.1.5-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"}},{"package":{"name":"msgpack-c","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/msgpack-c?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.1-3"],"ecosystem_specific":{"binaries":[{"binary_version":"3.0.1-3","binary_name":"libmsgpackc2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"}},{"package":{"name":"msgpack-c","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/msgpack-c?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.0-4"],"ecosystem_specific":{"binaries":[{"binary_version":"3.3.0-4","binary_name":"libmsgpackc2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"}},{"package":{"name":"msgpack-c","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/msgpack-c?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.0.0-3","4.0.0-3build1"],"ecosystem_specific":{"binaries":[{"binary_name":"libmsgpackc2","binary_version":"4.0.0-3build1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"}},{"package":{"name":"msgpack-c","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/msgpack-c?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["6.0.1-3","6.1.0-2"],"ecosystem_specific":{"binaries":[{"binary_name":"libmsgpack-c2","binary_version":"6.1.0-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L"},{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]}