Skip to main content

msgpack-ruby EUVDEUVD-2026-51235

| CVE-2026-54522 LOW
Use After Free (CWE-416)
2026-07-30 GitHub_M GHSA-4mrv-5p47-p938
2.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Execute code in target Ruby process
  2. Delivery
    Call Buffer#clear to return rmem page with stale cursors
  3. Exploit
    Trigger second Buffer allocation in same process
  4. Execution
    Second buffer reclaims freed rmem page
  5. Persist
    Read first buffer to obtain second buffer's bytes
  6. Impact
    Disclose 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

msgpack-ruby < 1.8.2

Affected Packages

rubygems msgpack fix: 1.8.2
euvd msgpack_ruby fix: 1.8.2

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

Vendor (GitHub_M) PRIMARY 2.1 LOW
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
vuln.today AI 5.1 MEDIUM

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.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Jul 30, 2026 - 18:03 EUVD

DescriptionCVE.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

EPSS Score
0.1%
Top 98% exploitable
Prevalence
Medium
popular Ruby serialization library used across many Ruby/Rails applications
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA MSRC CIRCL GitHub VulDB

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.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy