# CVE-2026-54522: MessagePack::Buffer#clear Use-After-Free that Enables Cross-Buffer Disclosure

> A use-after-free in MessagePack for Ruby allows attackers to disclose or corrupt data across buffers via stale memory references.

- **Severity:** Low 2.1 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2026
- **Updated:** 30 Jul 2026
- **Also known as:** AZL-109539, AZL-94449, CLEANSTART-2026-ES40374, DEBIAN-CVE-2026-54522, GHSA-4mrv-5p47-p938, MINI-274c-6h97-qvmp, MINI-3p2f-gpjq-4gp2, MINI-43q9-rg3j-g4vp, MINI-65ph-2qvj-gq8f, MINI-7f3f-3vfh-9ghx, MINI-7gpg-3ffp-chpx, MINI-7h25-98x6-5qxp, MINI-7j7h-4896-2gqj, MINI-83gc-h2pf-5m92, MINI-83v5-xp8p-r69c, MINI-8q95-g397-g6f4, MINI-942c-94x9-73p2, MINI-978c-hfhr-h6rj, MINI-c2pp-f9x7-xv84, MINI-gmqh-x47v-p73q, MINI-q8h7-ggg9-67rv, MINI-wx7v-j52p-x47m, OESA-2026-3219, OESA-2026-3220, OESA-2026-3221, UBUNTU-CVE-2026-54522

## What is CVE-2026-54522?

CVE-2026-54522 is a low-severity use after free vulnerability in msgpack-ruby, published on 30 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

MessagePack for Ruby is an implementation of the MessagePack binary serialization format. Prior to 1.8.2, MessagePack::Buffer#clear in ext/msgpack/buffer.c leaves rmem_last, rmem_end, and rmem_owner stale after _msgpack_buffer_shift_chunk returns an rmem page to the shared pool, allowing a subsequent Buffer#write and a second MessagePack::Buffer to alias the page and disclose or corrupt cross-buffer data. This issue is fixed in version 1.8.2.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2026-54522?

2 open source packages ship an affected version, including msgpack. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `msgpack` | RubyGems | All versions | 1.8.2 |
| `msgpack` | RubyGems | All versions | 1.8.2 |

Products: Msgpack Messagepack.

## How do I fix CVE-2026-54522?

Upgrade msgpack to 1.8.2 or later.

## Is CVE-2026-54522 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54522 exists.

## Other vulnerabilities in msgpack-ruby

- [CVE-2026-57585](https://insights.sbomify.com/CVE-2026-57585/): MessagePack: Out-of-bounds read/crash on Unpacker reuse after caught error (high 7.5)
- [CVE-2026-21452](https://insights.sbomify.com/CVE-2026-21452/): MessagePack for Java Vulnerable to Remote DoS via Malicious EXT Payload Allocation (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-54522 and fix it if it is affected.

What it is: CVE-2026-54522 is a low-severity use after free vulnerability in msgpack-ruby, published on 30 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54522 exists.

Affected packages and fixed versions:
- msgpack (RubyGems): affected all versions; fixed in 1.8.2
- msgpack (RubyGems): affected all versions; fixed in 1.8.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-54522/ (Markdown: https://insights.sbomify.com/CVE-2026-54522/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-54522
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-54522
- OSV: https://osv.dev/vulnerability/CVE-2026-54522

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-54522/
Summaries are generated and may contain mistakes; the official description above is the record.
