CVE-2026-114613
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
CVE-2026-114613- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-401
- Updated
- 2026-11-02
EUVDEUVD-2026-108280
7.5
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
EUVD-2026-108280- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-j586-36cw-2gc2
7.5
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
Impact
The msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests.
The report measured approximately 4 MiB retained per failed parse and 100 MiB after 25 failed parses on Windows with Python 3.14 and msgpack 1.2.2. These are reporter-provided results.
Additional impact: stale parser-stack references
The reference-ownership audit performed while fixing this leak found an
additional memory-safety issue in the streaming Unpacker.
After unpack() completed a nested container, an inactive parser-stack slot
could retain a non-owning pointer to the decoded object. A subsequent skip()
could reactivate that slot. If parsing then failed, context cleanup treated the
stale pointer as an owned reference and decremented it.
This corrupts the object's reference count and can result in a use-after-free
or double Py_DECREF when its actual owners later release it.
Although few users use this API, but those who do may experience crashes or unexpected errors due to a use-after-free.
Details
In msgpack/unpack.h, unpack_callback_map_item() rejects keys that are neither str nor bytes. At this point the map value has already been constructed. The early error return does not release the value reference.
In msgpack/unpack_template.h, the value is held in the local obj in unpack_execute(). The CT_MAP_VALUE error path jumps to _failed without decrementing that reference. Cleanup of the parser stack does not recover the value because it is not stored in the stack. The fallback checks the key before decoding the value.
Affected versions
The report reproduces the issue on 1.2.2 and reports it on development commit 475c1b7. The affected-product field lists the reproduced release only; it is not a claim that earlier releases are unaffected.
The earliest affected release needs confirmation: the report's summary says 1.1.x through 1.2.2, while its root-cause analysis attributes introduction to commit cd81370 (PR #673). Resolve this discrepancy before publishing a definitive affected-version range.
Reproduction
Run in a disposable local process with the C extension installed:
import msgpack
payload = msgpack.packb({42: b"A" * (4 * 1024 * 1024)}, use_bin_type=True)
msgpack.unpackb(payload) # Raises ValueError; the report observes a 4 MiB leak.
Streaming API trigger:
import msgpack
payload = msgpack.packb({42: b"A" * (4 * 1024 * 1024)}, use_bin_type=True)
u = msgpack.Unpacker()
u.feed(payload)
list(u) # Same strict_map_key error path.
Workarounds
The pure-Python fallback is reported not to leak on this path and may be used as a temporary workaround after application compatibility and performance checks. Request-size and rate limits may reduce the impact but do not eliminate cumulative leakage.
- Record
GHSA-j586-36cw-2gc2- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-401, CWE-416
- Updated
- 2026-11-02
NVD
7.5
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
CVE-2026-114613- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-401
- Updated
- 2026-11-02
OSV
7.5
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
CVE-2026-114613- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-401
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-114613
7.5
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
DEBIAN-CVE-2026-114613- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVGHSA-j586-36cw-2gc2
7.5
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
Impact
The msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests.
The report measured approximately 4 MiB retained per failed parse and 100 MiB after 25 failed parses on Windows with Python 3.14 and msgpack 1.2.2. These are reporter-provided results.
Additional impact: stale parser-stack references
The reference-ownership audit performed while fixing this leak found an
additional memory-safety issue in the streaming Unpacker.
After unpack() completed a nested container, an inactive parser-stack slot
could retain a non-owning pointer to the decoded object. A subsequent skip()
could reactivate that slot. If parsing then failed, context cleanup treated the
stale pointer as an owned reference and decremented it.
This corrupts the object's reference count and can result in a use-after-free
or double Py_DECREF when its actual owners later release it.
Although few users use this API, but those who do may experience crashes or unexpected errors due to a use-after-free.
Details
In msgpack/unpack.h, unpack_callback_map_item() rejects keys that are neither str nor bytes. At this point the map value has already been constructed. The early error return does not release the value reference.
In msgpack/unpack_template.h, the value is held in the local obj in unpack_execute(). The CT_MAP_VALUE error path jumps to _failed without decrementing that reference. Cleanup of the parser stack does not recover the value because it is not stored in the stack. The fallback checks the key before decoding the value.
Affected versions
The report reproduces the issue on 1.2.2 and reports it on development commit 475c1b7. The affected-product field lists the reproduced release only; it is not a claim that earlier releases are unaffected.
The earliest affected release needs confirmation: the report's summary says 1.1.x through 1.2.2, while its root-cause analysis attributes introduction to commit cd81370 (PR #673). Resolve this discrepancy before publishing a definitive affected-version range.
Reproduction
Run in a disposable local process with the C extension installed:
import msgpack
payload = msgpack.packb({42: b"A" * (4 * 1024 * 1024)}, use_bin_type=True)
msgpack.unpackb(payload) # Raises ValueError; the report observes a 4 MiB leak.
Streaming API trigger:
import msgpack
payload = msgpack.packb({42: b"A" * (4 * 1024 * 1024)}, use_bin_type=True)
u = msgpack.Unpacker()
u.feed(payload)
list(u) # Same strict_map_key error path.
Workarounds
The pure-Python fallback is reported not to leak on this path and may be used as a temporary workaround after application compatibility and performance checks. Request-size and rate limits may reduce the impact but do not eliminate cumulative leakage.
- Record
GHSA-j586-36cw-2gc2- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-401, CWE-416
- Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2026-114613
7.5
CVE-2026-114613 in msgpack - Patched by Root
Root has patched CVE-2026-114613 in the msgpack package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-114613- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-06
OSVAZL-111044 No score
CVE-2026-114613 affecting package python-msgpack for versions less than 1.2.3-1
MessagePack is the serializer implementation for Python msgpack.org. Prior to 1.2.3, the msgpack-python C extension (msgpack._cmsgpack) leaks a decoded map value when deserialization rejects a key with strict_map_key=True (the default). Repeated malformed inputs can cause unbounded process memory growth and denial of service in applications that deserialize attacker-controlled MessagePack data. Both unpackb() and the streaming Unpacker API are affected. The pure-Python fallback does not exhibit this leak in the reported tests. This issue is fixed in version 1.2.3.
- Record
AZL-111044- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
msgpackPyPI |
before 1.2.3 | 1.2.3 |
python-msgpackAzure Linux:3 |
before 1.2.3-1 | 1.2.3-1 |
python-msgpackDebian:12 |
All versions, plus listed versions 1.0.3-21.0.3-31.1.2-11.1.2-21.1.2-31.1.2-41.2.1-1 |
None known |
python-msgpackDebian:13 |
All versions, plus listed versions 1.0.3-31.1.2-11.1.2-21.1.2-31.1.2-41.2.1-1 |
None known |
python-msgpackDebian:14 |
All versions, plus listed versions 1.0.3-31.1.2-11.1.2-21.1.2-31.1.2-41.2.1-1 |
None known |
msgpackPyPI |
before 1.2.3, plus listed versions 0.5.00.5.10.5.20.5.30.5.4 Show 29 moreShow less0.5.50.5.60.6.00.6.10.6.21.0.01.0.0rc11.0.11.0.21.0.31.0.3rc11.0.41.0.4rc11.0.51.0.5rc11.0.61.0.6rc11.0.71.0.81.1.01.1.0rc11.1.0rc21.1.11.1.1rc11.1.21.2.01.2.0rc11.2.11.2.2 |
1.2.3 |
msgpackRoot:PyPI |
before 1.1.1+aikido.3 | 1.1.1+aikido.31.2.1+aikido.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-114613 is a high vulnerability (CVSS 7.5) in Msgpack Msgpack-python, published October 22, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.54%, the 45th percentile. Fixed in msgpack 1.2.3.
References
github.com/msgpack/msgpack-python/security/advisories/GHSA-j586-36cw-2gc2
github.com/msgpack/msgpack-python/commit/620b0eb4c89cd72d4098564537624d9dbb2ce141
github.com/msgpack/msgpack-python/releases/tag/v1.2.3
nvd.nist.gov/vuln/detail/CVE-2026-114613
github.com/advisories/GHSA-j586-36cw-2gc2
github.com/CVEProject/cvelistV5/tree/main/cves/2026/114xxx/CVE-2026-114613.json
security-tracker.debian.org/tracker/CVE-2026-114613
github.com/msgpack/msgpack-python