CVE-2026-54522: MessagePack::Buffer#clear Use-After-Free that Enables Cross-Buffer Disclosure
MessagePack::Buffer#clear shifts out every chunk and returns its 4 KiB rmem page to the shared pool, but does not reset the buffer’s rmem cursor (rmem_last, rmem_end, rmem_owner). The next write sees “unused rmem space” left over from the freed page and hands back a slice of memory that has already been returned to the pool. A second MessagePack::Buffer then re-acquires that same page, so reading the cleared-and-rewritten buffer discloses the second buffer’s bytes — a same-process use-after-free with cross-buffer information disclosure (and the symmetric write-corruption).
References
- github.com/advisories/GHSA-4mrv-5p47-p938
- github.com/msgpack/msgpack-ruby/commit/5627d71606b565641d2dd501b82aae862f4abe90
- github.com/msgpack/msgpack-ruby/security/advisories/GHSA-4mrv-5p47-p938
- github.com/rubysec/ruby-advisory-db/blob/master/gems/msgpack/CVE-2026-54522.yml
- nvd.nist.gov/vuln/detail/CVE-2026-54522
- www.cve.org/CVERecord/SearchResults?query=CVE-2026-54522
Code Behaviors & Features
Detect and mitigate CVE-2026-54522 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →