Common Weakness Enumeration

CWE-401

Allowed

Missing Release of Memory after Effective Lifetime

Abstraction: Variant · Status: Draft

The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.

2284 vulnerabilities reference this CWE, most recent first.

GHSA-J3Q7-2R25-Q5J7

Vulnerability from github – Published: 2023-11-27 00:30 – Updated: 2023-11-27 00:30
VLAI
Details

A vulnerability, which was classified as problematic, has been found in Apryse iText 8.0.2. This issue affects some unknown processing of the file PdfDocument.java of the component Reference Table Handler. The manipulation leads to memory leak. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier VDB-246125 was assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-6299"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-11-26T23:15:07Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability, which was classified as problematic, has been found in Apryse iText 8.0.2. This issue affects some unknown processing of the file PdfDocument.java of the component Reference Table Handler. The manipulation leads to memory leak. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier VDB-246125 was assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.",
  "id": "GHSA-j3q7-2r25-q5j7",
  "modified": "2023-11-27T00:30:31Z",
  "published": "2023-11-27T00:30:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-6299"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/file/d/1_jeD7SvuliKc_02pPTPbfSnqAErzmFny/view?usp=sharing"
    },
    {
      "type": "WEB",
      "url": "https://kb.itextpdf.com/home/it7kb/releases/release-itext-core-8-0-2#ReleaseiTextCore8.0.2-Bugfixesandmiscellaneous"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?ctiid.246125"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.246125"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J42J-7596-MCR4

Vulnerability from github – Published: 2022-05-24 17:17 – Updated: 2024-03-21 03:33
VLAI
Details

gss_mech_free in net/sunrpc/auth_gss/gss_mech_switch.c in the rpcsec_gss_krb5 implementation in the Linux kernel through 5.6.10 lacks certain domain_release calls, leading to a memory leak.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2020-12656"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401",
      "CWE-772"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2020-05-05T06:15:00Z",
    "severity": "LOW"
  },
  "details": "gss_mech_free in net/sunrpc/auth_gss/gss_mech_switch.c in the rpcsec_gss_krb5 implementation in the Linux kernel through 5.6.10 lacks certain domain_release calls, leading to a memory leak.",
  "id": "GHSA-j42j-7596-mcr4",
  "modified": "2024-03-21T03:33:55Z",
  "published": "2022-05-24T17:17:11Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-12656"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.kernel.org/show_bug.cgi?id=206651"
    },
    {
      "type": "WEB",
      "url": "https://usn.ubuntu.com/4483-1"
    },
    {
      "type": "WEB",
      "url": "https://usn.ubuntu.com/4485-1"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00008.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J48F-PHXX-H43M

Vulnerability from github – Published: 2022-05-24 22:00 – Updated: 2022-05-24 22:00
VLAI
Details

ImageMagick 7.0.8-40 has a memory leak in Huffman2DEncodeImage in coders/ps2.c.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2019-16711"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401",
      "CWE-772"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2019-09-23T12:15:00Z",
    "severity": "MODERATE"
  },
  "details": "ImageMagick 7.0.8-40 has a memory leak in Huffman2DEncodeImage in coders/ps2.c.",
  "id": "GHSA-j48f-phxx-h43m",
  "modified": "2022-05-24T22:00:41Z",
  "published": "2022-05-24T22:00:41Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-16711"
    },
    {
      "type": "WEB",
      "url": "https://github.com/ImageMagick/ImageMagick/issues/1542"
    },
    {
      "type": "WEB",
      "url": "https://usn.ubuntu.com/4192-1"
    },
    {
      "type": "WEB",
      "url": "https://www.debian.org/security/2020/dsa-4712"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00040.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00042.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J48M-667V-9R7R

Vulnerability from github – Published: 2025-09-16 15:32 – Updated: 2025-12-03 18:30
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

ubifs: Fix memory leak in ubifs_sysfs_init()

When insmod ubifs.ko, a kmemleak reported as below:

unreferenced object 0xffff88817fb1a780 (size 8): comm "insmod", pid 25265, jiffies 4295239702 (age 100.130s) hex dump (first 8 bytes): 75 62 69 66 73 00 ff ff ubifs... backtrace: [] slab_post_alloc_hook+0x9c/0x3c0 [] __kmalloc_track_caller+0x183/0x410 [] kstrdup+0x3a/0x80 [] kstrdup_const+0x66/0x80 [] kvasprintf_const+0x155/0x190 [] kobject_set_name_vargs+0x5b/0x150 [] kobject_set_name+0xbb/0xf0 [] do_one_initcall+0x14c/0x5a0 [] do_init_module+0x1f0/0x660 [] load_module+0x6d7e/0x7590 [] __do_sys_finit_module+0x19f/0x230 [] __x64_sys_finit_module+0x73/0xb0 [] do_syscall_64+0x35/0x80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd

When kset_register() failed, we should call kset_put to cleanup it.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-53278"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-09-16T08:15:36Z",
    "severity": "MODERATE"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nubifs: Fix memory leak in ubifs_sysfs_init()\n\nWhen insmod ubifs.ko, a kmemleak reported as below:\n\n unreferenced object 0xffff88817fb1a780 (size 8):\n   comm \"insmod\", pid 25265, jiffies 4295239702 (age 100.130s)\n   hex dump (first 8 bytes):\n     75 62 69 66 73 00 ff ff                          ubifs...\n   backtrace:\n     [\u003cffffffff81b3fc4c\u003e] slab_post_alloc_hook+0x9c/0x3c0\n     [\u003cffffffff81b44bf3\u003e] __kmalloc_track_caller+0x183/0x410\n     [\u003cffffffff8198d3da\u003e] kstrdup+0x3a/0x80\n     [\u003cffffffff8198d486\u003e] kstrdup_const+0x66/0x80\n     [\u003cffffffff83989325\u003e] kvasprintf_const+0x155/0x190\n     [\u003cffffffff83bf55bb\u003e] kobject_set_name_vargs+0x5b/0x150\n     [\u003cffffffff83bf576b\u003e] kobject_set_name+0xbb/0xf0\n     [\u003cffffffff8100204c\u003e] do_one_initcall+0x14c/0x5a0\n     [\u003cffffffff8157e380\u003e] do_init_module+0x1f0/0x660\n     [\u003cffffffff815857be\u003e] load_module+0x6d7e/0x7590\n     [\u003cffffffff8158644f\u003e] __do_sys_finit_module+0x19f/0x230\n     [\u003cffffffff815866b3\u003e] __x64_sys_finit_module+0x73/0xb0\n     [\u003cffffffff88c98e85\u003e] do_syscall_64+0x35/0x80\n     [\u003cffffffff88e00087\u003e] entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nWhen kset_register() failed, we should call kset_put to cleanup it.",
  "id": "GHSA-j48m-667v-9r7r",
  "modified": "2025-12-03T18:30:20Z",
  "published": "2025-09-16T15:32:33Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-53278"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1c5fdf2d4647219d2267ccb08c7f2c7095bf3450"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/203a55f04f66eea1a1ca7e5a302a7f5c99c62327"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/d42c2b18c42da7378e67b6414aafe93b65de89d1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J48P-M2M2-H4M7

Vulnerability from github – Published: 2022-05-24 19:07 – Updated: 2022-05-24 19:07
VLAI
Details

A missing release of memory after its effective lifetime vulnerability in the Webmail of FortiMail 6.4.0 through 6.4.4 and 6.2.0 through 6.2.6 may allow an unauthenticated remote attacker to exhaust available memory via specifically crafted login requests.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-26090"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-07-12T13:15:00Z",
    "severity": "HIGH"
  },
  "details": "A missing release of memory after its effective lifetime vulnerability in the Webmail of FortiMail 6.4.0 through 6.4.4 and 6.2.0 through 6.2.6 may allow an unauthenticated remote attacker to exhaust available memory via specifically crafted login requests.",
  "id": "GHSA-j48p-m2m2-h4m7",
  "modified": "2022-05-24T19:07:31Z",
  "published": "2022-05-24T19:07:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-26090"
    },
    {
      "type": "WEB",
      "url": "https://fortiguard.com/advisory/FG-IR-21-042"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-J4C7-RFXG-2M4P

Vulnerability from github – Published: 2026-09-11 03:30 – Updated: 2026-09-11 03:30
VLAI
Details

libcharon in strongSwan 4.1.2 through 6.0.7 has a missing release of memory after its effective lifetime in the IKE message parser.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-78127"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-09-11T02:18:34Z",
    "severity": "LOW"
  },
  "details": "libcharon in strongSwan 4.1.2 through 6.0.7 has a missing release of memory after its effective lifetime in the IKE message parser.",
  "id": "GHSA-j4c7-rfxg-2m4p",
  "modified": "2026-09-11T03:30:21Z",
  "published": "2026-09-11T03:30:21Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-78127"
    },
    {
      "type": "WEB",
      "url": "https://github.com/strongswan/strongswan/releases/tag/6.1.0"
    },
    {
      "type": "WEB",
      "url": "https://www.strongswan.org/blog/2026/09/07/strongswan-vulnerability-(cve-2026-78127).html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J4J9-J24X-79RM

Vulnerability from github – Published: 2025-06-18 12:30 – Updated: 2025-11-18 18:32
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

RDMA/hfi1: fix potential memory leak in setup_base_ctxt()

setup_base_ctxt() allocates a memory chunk for uctxt->groups with hfi1_alloc_ctxt_rcv_groups(). When init_user_ctxt() fails, uctxt->groups is not released, which will lead to a memory leak.

We should release the uctxt->groups with hfi1_free_ctxt_rcv_groups() when init_user_ctxt() fails.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-50134"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-06-18T11:15:43Z",
    "severity": "MODERATE"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/hfi1: fix potential memory leak in setup_base_ctxt()\n\nsetup_base_ctxt() allocates a memory chunk for uctxt-\u003egroups with\nhfi1_alloc_ctxt_rcv_groups(). When init_user_ctxt() fails, uctxt-\u003egroups\nis not released, which will lead to a memory leak.\n\nWe should release the uctxt-\u003egroups with hfi1_free_ctxt_rcv_groups()\nwhen init_user_ctxt() fails.",
  "id": "GHSA-j4j9-j24x-79rm",
  "modified": "2025-11-18T18:32:46Z",
  "published": "2025-06-18T12:30:50Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-50134"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1750be1e9f18787cf717c24dbc5fa029fc372a22"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/2f90813f1c21c3d780585390af961bd17c8515ae"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/90ef48a718f88935d4af53d7dadd1ceafe103ce6"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/a85c7dd1edadcdeca24e603a6618153a3bcc81ca"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/a9055dfe437efae77e28e57205437c878a03ccb7"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/aa2a1df3a2c85f855af7d54466ac10bd48645d63"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/e25b828553aecb3185a8d8d0c4f9b4e133fb5db6"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/fc4de8009fd6c2ca51986c6757efa964040e7d02"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J4JV-9RJV-H6JM

Vulnerability from github – Published: 2022-05-24 17:45 – Updated: 2022-05-24 17:45
VLAI
Details

A flaw was found in Privoxy in versions before 3.0.29. Memory leak in the show-status CGI handler when no filter files are configured can lead to a system crash.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-20210"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-03-25T19:15:00Z",
    "severity": "HIGH"
  },
  "details": "A flaw was found in Privoxy in versions before 3.0.29. Memory leak in the show-status CGI handler when no filter files are configured can lead to a system crash.",
  "id": "GHSA-j4jv-9rjv-h6jm",
  "modified": "2022-05-24T17:45:22Z",
  "published": "2022-05-24T17:45:22Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-20210"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=1928729"
    },
    {
      "type": "WEB",
      "url": "https://security.gentoo.org/glsa/202107-16"
    },
    {
      "type": "WEB",
      "url": "https://www.privoxy.org/3.0.29/user-manual/whatsnew.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-J546-3M5X-FX7P

Vulnerability from github – Published: 2022-05-24 19:09 – Updated: 2022-05-24 19:09
VLAI
Details

In Eclipse Mosquitto version 1.6 to 2.0.10, if an authenticated client that had connected with MQTT v5 sent a crafted CONNECT message to the broker a memory leak would occur, which could be used to provide a DoS attack against the broker.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-34431"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-07-22T14:15:00Z",
    "severity": "MODERATE"
  },
  "details": "In Eclipse Mosquitto version 1.6 to 2.0.10, if an authenticated client that had connected with MQTT v5 sent a crafted CONNECT message to the broker a memory leak would occur, which could be used to provide a DoS attack against the broker.",
  "id": "GHSA-j546-3m5x-fx7p",
  "modified": "2022-05-24T19:09:00Z",
  "published": "2022-05-24T19:09:00Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-34431"
    },
    {
      "type": "WEB",
      "url": "https://bugs.eclipse.org/bugs/show_bug.cgi?id=573191"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-J586-36CW-2GC2

Vulnerability from github – Published: 2026-10-27 15:04 – Updated: 2026-10-27 15:04
VLAI
Summary
MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure
Details

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.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "msgpack"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.2.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-114613"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-401",
      "CWE-416"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-27T15:04:07Z",
    "nvd_published_at": "2026-10-22T19:17:37Z",
    "severity": "HIGH"
  },
  "details": "### Impact\n\nThe 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.\n\nThe 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.\n\n### Additional impact: stale parser-stack references\n\nThe reference-ownership audit performed while fixing this leak found an\nadditional memory-safety issue in the streaming `Unpacker`.\n\nAfter `unpack()` completed a nested container, an inactive parser-stack slot\ncould retain a non-owning pointer to the decoded object. A subsequent `skip()`\ncould reactivate that slot. If parsing then failed, context cleanup treated the\nstale pointer as an owned reference and decremented it.\n\nThis corrupts the object\u0027s reference count and can result in a use-after-free\nor double `Py_DECREF` when its actual owners later release it.\n\nAlthough few users use this API, but those who do may experience crashes or unexpected errors due to a use-after-free.\n\n### Details\n\nIn `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.\n\nIn `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.\n\n### Affected versions\n\nThe 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.\n\nThe earliest affected release needs confirmation: the report\u0027s 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.\n\n### Reproduction\n\nRun in a disposable local process with the C extension installed:\n\n```python\nimport msgpack\n\npayload = msgpack.packb({42: b\"A\" * (4 * 1024 * 1024)}, use_bin_type=True)\nmsgpack.unpackb(payload)  # Raises ValueError; the report observes a 4 MiB leak.\n```\n\nStreaming API trigger:\n\n```python\nimport msgpack\n\npayload = msgpack.packb({42: b\"A\" * (4 * 1024 * 1024)}, use_bin_type=True)\nu = msgpack.Unpacker()\nu.feed(payload)\nlist(u)  # Same strict_map_key error path.\n```\n\n### Workarounds\n\nThe 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.",
  "id": "GHSA-j586-36cw-2gc2",
  "modified": "2026-10-27T15:04:07Z",
  "published": "2026-10-27T15:04:07Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/msgpack/msgpack-python/security/advisories/GHSA-j586-36cw-2gc2"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114613"
    },
    {
      "type": "WEB",
      "url": "https://github.com/msgpack/msgpack-python/commit/620b0eb4c89cd72d4098564537624d9dbb2ce141"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/msgpack/msgpack-python"
    },
    {
      "type": "WEB",
      "url": "https://github.com/msgpack/msgpack-python/releases/tag/v1.2.3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "MessagePack: Unbounded memory leak in msgpack C extension on strict_map_key validation failure"
}

Mitigation MIT-41
Implementation

Strategy: Libraries or Frameworks

  • Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone.
  • For example, glibc in Linux provides protection against free of invalid pointers.
  • When using Xcode to target OS X or iOS, enable automatic reference counting (ARC) [REF-391].
  • To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std::auto_ptr (defined by ISO/IEC ISO/IEC 14882:2003), std::shared_ptr and std::unique_ptr (specified by an upcoming revision of the C++ standard, informally referred to as C++ 1x), or equivalent solutions such as Boost.
Mitigation
Architecture and Design

Use an abstraction library to abstract away risky APIs. Not a complete solution.

Mitigation
Architecture and Design Build and Compilation

Consider using the Boehm-Demers-Weiser garbage collector (bdwgc), which can help avoid leaks.

No CAPEC attack patterns related to this CWE.