Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessExecute code in target Ruby process
-
DeliveryCall Buffer#clear to return rmem page with stale cursors
-
ExploitTrigger second Buffer allocation in same process
-
ExecutionSecond buffer reclaims freed rmem page
-
PersistRead first buffer to obtain second buffer's bytes
-
ImpactDisclose cross-buffer sensitive data
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires same-process code execution in a CRuby (MRI) application using the msgpack-ruby C extension (version <= 1.8.1). The specific sequence is: (1) a MessagePack::Buffer is written to and then explicitly cleared via Buffer#clear, which causes its rmem page to be returned to the shared slab pool with rmem_last/rmem_end/rmem_owner left stale; and (2) a second MessagePack::Buffer is allocated within the same process - concurrently or immediately after - reclaiming that same physical page from the pool. Exploitation is limited to actors who can execute Ruby code within the target process, which in practice means a bug or injection in multi-tenant application logic, a malicious gem, or a co-located tenant in a shared-worker deployment. Pure-Ruby builds and JRuby are not affected. The rmem bitmask slab design means standard ASAN instrumentation does not detect the access, making it harder to detect passively. What limits exploitation: the attacker cannot trigger this from outside the process (no network-only path); the AT:P metric confirms special timing/sequence conditions must align. |
| Impact | The official CVSS 4.0 vector (AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N) scores 2.1, reflecting local attack scope and low confidentiality impact with no integrity or availability effect. The AT:P metric confirms a specific exploitation precondition must be satisfied. No EPSS data was provided in the intelligence; KEV status is not listed. A PoC script demonstrating the cross-buffer disclosure is embedded in the vendor advisory (GHSA-4mrv-5p47-p938), which elevates practical risk slightly above what the raw score implies. Notably, the vendor advisory explicitly mentions 'the symmetric write-corruption' alongside the information disclosure, suggesting an integrity impact that the official VI:N metric does not capture - this discrepancy should be noted when scoring internally. Real-world risk is bounded tightly by the same-process constraint: a remote network attacker cannot exploit this without already executing Ruby code in the target process. Multi-tenant Rack or Sidekiq worker processes that handle multiple tenants in a single MRI process represent the realistic threat boundary. |
| Exploit ScenarioDerived | A PoC demonstrating the disclosure is provided in GHSA-4mrv-5p47-p938. In a multi-tenant Puma or Sidekiq worker process, an attacker's request triggers Buffer#clear on a msgpack buffer after writing data into it; a concurrent request in the same process worker then allocates a new MessagePack::Buffer that reclaims the exact same 4 KiB rmem page. When the attacker's buffer is subsequently read, it returns bytes from the second request's serialized payload - such as session tokens or personal data - constituting a cross-tenant information disclosure within the same Ruby process. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 30, 2026
Cross-buffer memory aliasing in msgpack-ruby prior to 1.8.2 allows same-process code to read or corrupt data belonging to a separate MessagePack::Buffer instance via a use-after-free in the rmem slab allocator. MessagePack::Buffer#clear returns a 4 KiB rmem page to the shared pool but leaves rmem_last, rmem_end, and rmem_owner pointing into the freed page; a subsequent write on the cleared buffer and a concurrent second Buffer allocation can claim the same physical page, creating a memory alias that exposes the second buffer's serialized bytes. A PoC is included in the vendor advisory (GHSA-4mrv-5p47-p938); no public exploit identified at time of analysis beyond that PoC, and the CVE is not in CISA KEV.
RemediationAI
Upgrade msgpack-ruby to version 1.8.2, which is confirmed fixed by the vendor advisory (GHSA-4mrv-5p47-p938) and the patch commit at https://github.com/msgpack/msgpack-ruby/commit/5627d71606b565641d2dd501b82aae862f4abe90. The fix adds three NULL assignments (rmem_end = NULL, rmem_last = NULL, rmem_owner = NULL) in _msgpack_buffer_shift_chunk immediately after returning the page to the pool, eliminating the stale-pointer condition with no functional trade-offs. If an immediate upgrade is not possible, isolate sensitive buffer operations by ensuring that MessagePack::Buffer instances carrying confidential data (e.g., session tokens, PII) complete their full lifecycle - including any Buffer#clear calls - in a code path that does not interleave with concurrent buffer allocations in the same process thread or fiber. Switching to a forked process-per-request model (e.g., Unicorn instead of Puma in cluster mode) eliminates the shared rmem pool across requests, removing the aliasing window at the cost of higher per-process memory overhead.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in rubygems, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability is in ext/msgpack/buffer.c of the CRuby (MRI) C extension for msgpack-ruby (CPE: cpe:2.3:a:msgpack:msgpack-ruby:*:*:*:*:*:*:*:*). The rmem subsystem (ext/msgpack/rmem.h) recycles fixed-size 4 KiB memory pages using a bitmask slab, not system malloc/free. When _msgpack_buffer_shift_chunk (buffer.c:128) calls msgpack_rmem_free to return a page to the pool, it correctly updates tail_buffer_end and read_buffer but leaves three cursor fields - rmem_last, rmem_end, and rmem_owner - pointing into the now-freed page. A subsequent Buffer#write triggers the _msgpack_buffer_chunk_malloc reuse branch (buffer.c:363), which returns b->rmem_last as a valid write destination even though that address belongs to the pool's free list. A second MessagePack::Buffer allocating its first chunk via msgpack_rmem_alloc then reclaims that same physical page, aliasing the two buffers in memory. CWE-416 (Use After Free) is the correct root cause classification; however, because rmem recycles via bitmask and not system allocator free, standard AddressSanitizer builds do not abort on the access - the cross-buffer data disclosure is the only observable symptom in a non-instrumented environment.
Know when Msgpack Ruby gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
AV:L for same-process local constraint; PR:N because no special OS privileges needed; I:L added because the advisory explicitly documents write-corruption alongside disclosure.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
EUVD-2026-51235
GHSA-4mrv-5p47-p938
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB