Skip to content
Heist/ feed
Back to feed
Medium

msgpack-c — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-72854

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.

Products
msgpack-c
Affected versions
2.1.5-1, 3.0.1-3, 3.3.0-4, 4.0.0-3, 4.0.0-3build1, 6.0.1-3, 6.1.0-2, 7.0.1-1
Fixed versions
Not specified
CVEs
CVE-2026-72854
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 03:15 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-72854

core-osv · Original source

Published 20 Aug 2026, 19:17 UTC

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.

osv:UBUNTU-CVE-2026-72854

msgpack-c

Fixed versions: Not specified

msgpack-c

Fixed versions: Not specified

msgpack-c

Fixed versions: Not specified

msgpack-c

Fixed versions: Not specified

msgpack-c

Fixed versions: Not specified

msgpack-c

Fixed versions: Not specified

Complete source record
{
  "id": "8211a52527aff685a9edaab8c8d84feee618dcac7bcf734721d146cf31124f1e",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-72854",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-72854",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2026-72854",
    "products": [
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.1.5-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.0.1-3",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3.3.0-4",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.0.0-3",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "4.0.0-3build1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.1.0-2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "7.0.1-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "msgpack-c",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "6.0.1-3",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "6.1.0-2",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-72854",
      "aliases": [
        "UBUNTU-CVE-2026-72854"
      ],
      "metrics": [
        {
          "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "2.1.5-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpackc2",
                "binary_version": "2.1.5-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "3.0.1-3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpackc2",
                "binary_version": "3.0.1-3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "3.3.0-4"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpackc2",
                "binary_version": "3.3.0-4"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "4.0.0-3",
            "4.0.0-3build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpackc2",
                "binary_version": "4.0.0-3build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "6.1.0-2",
            "7.0.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpack-c2",
                "binary_version": "7.0.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "msgpack-c",
            "purl": "pkg:deb/ubuntu/msgpack-c?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "6.0.1-3",
            "6.1.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-72854.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmsgpack-c2",
                "binary_version": "6.1.0-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T13:00:53.047597400Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-72854"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-72854",
        "https://www.cve.org/CVERecord?id=CVE-2026-72854"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-72854",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 360854,
  "published_at": "2026-08-20T19:17:00+00:00"
}