CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-54522

CVE-2026-54522: Same-Process Use-After-Free and Cross-Buffer Data Disclosure in msgpack-ruby

Alon Barad
Alon Barad
Software Engineer

Jul 30, 2026·5 min read·4 visits

Executive Summary (TL;DR)

A Use-After-Free in msgpack-ruby < 1.8.2 allows cross-buffer memory aliasing, resulting in same-process information disclosure and stream corruption when buffers are cleared and reused.

A Use-After-Free (UAF) vulnerability exists in msgpack-ruby prior to version 1.8.2. The MessagePack::Buffer#clear method returns the associated 4 KiB rmem page to the shared pool but fails to reset the buffer's tracking pointers (rmem_last, rmem_end, and rmem_owner). Subsequent write operations on the cleared buffer can alias the freed page, allowing concurrent buffers to access, disclose, or corrupt cross-buffer data. This issue is resolved in version 1.8.2.

Vulnerability Overview

MessagePack for Ruby (msgpack-ruby) is a binary serialization library that leverages a custom memory management subsystem to minimize allocation overhead. This subsystem, known as rmem, manages 4 KiB memory pages through a global pool, bypassing the standard glibc malloc/free cycles for performance optimization. Within this framework, individual MessagePack::Buffer objects track active memory pages utilizing cursors.

The vulnerability, designated as CVE-2026-54522 (and GHSA-4mrv-5p47-p938), is a same-process Use-After-Free (UAF) flaw residing in ext/msgpack/buffer.c. When MessagePack::Buffer#clear is called, the library returns the active memory page to the shared global allocator pool. However, it fails to nullify internal cursor tracking pointers, leaving them as stale references pointing to the now-freed memory page.

Subsequent write operations on the cleared buffer can reuse these stale pointers, mapping new write data directly onto the freed page. If another independent buffer has since been assigned that same page from the global pool, both buffers will alias the same physical memory space. This memory collision enables unauthenticated cross-buffer information disclosure and data corruption within the hosting process.

Root Cause Analysis

The root cause of the vulnerability lies in a tracking pointer desynchronization flaw during buffer flush operations. The msgpack_buffer_t structure manages memory chunks and relies on three tracking cursors to optimize subsequent allocations: rmem_last (start of the last allocated slice), rmem_end (end boundary of the page), and rmem_owner (the specific chunk currently owning the page).

When a developer invokes MessagePack::Buffer#clear, the function internally executes a loop that shifts out chunks by calling _msgpack_buffer_shift_chunk(). If the buffer becomes completely empty, the function releases the underlying rmem page back to the global pool using the _msgpack_buffer_chunk_destroy and msgpack_rmem_free calls.

While the underlying page is successfully freed, _msgpack_buffer_shift_chunk() fails to invalidate or nullify the rmem_last, rmem_end, and rmem_owner pointers. When the same buffer executes its next write, _msgpack_buffer_chunk_malloc() evaluates these pointers to determine if cached space remains in the active page. Because the pointers are non-NULL, the allocator erroneously concludes that the buffer still owns a valid, active page, returning a slice of memory pointing into the recycled pool page.

Code Analysis

An analysis of the vulnerable source code in ext/msgpack/buffer.c reveals the structural omission. In the vulnerable version, when the head of the buffer queue becomes NULL, the function resets the basic read pointers but leaves the rmem cursors untouched.

// Vulnerable code structure in ext/msgpack/buffer.c
bool _msgpack_buffer_shift_chunk(msgpack_buffer_t* b)
{
    // ... chunk shifting logic ...
    if(b->head == NULL) {
        b->tail_buffer_end = NULL;
        b->read_buffer = NULL;
        // Missing: Nullification of rmem_end, rmem_last, and rmem_owner
        return false;
    }
}

The patch implemented in version 1.8.2 corrects this omission by explicitly resetting the cursors to NULL, which prevents the allocation optimizer from attempting to write to a stale memory page.

// Patched code structure in ext/msgpack/buffer.c
bool _msgpack_buffer_shift_chunk(msgpack_buffer_t* b)
{
    // ... chunk shifting logic ...
    if(b->head == NULL) {
        b->tail_buffer_end = NULL;
        b->read_buffer = NULL;
        /* Explicitly clear the stale rmem cursors to prevent UAF */
        b->rmem_end = NULL;
        b->rmem_last = NULL;
        b->rmem_owner = NULL;
        return false;
    }
}

This fix ensures that once the buffer is cleared of all its chunks, any subsequent write operations are forced to request a fresh page allocation from the pool, preventing memory aliasing.

Exploitation Methodology

Exploitation of CVE-2026-54522 relies on specific application design patterns, such as the pooling or reuse of MessagePack::Buffer instances across concurrent connections or tasks within a single process. In high-throughput Ruby servers, this pattern is often implemented to minimize memory overhead.

The attack sequence is initiated when an attacker sends a request that populates and subsequently clears a shared buffer instance (Buffer 1). Following the clear operation, the attacker performs a minor write to Buffer 1, triggering the use of the stale tracking pointers. In parallel, a concurrent request (Buffer 2) requests memory from the global pool, and is assigned the recycled page.

Because both buffers point to the same physical memory, reading Buffer 1 will disclose the binary serialization stream written by Buffer 2. This stream can contain sensitive parameters, user credentials, or application session state. Conversely, writing to Buffer 1 will overwrite the active memory of Buffer 2, corrupting its serialized output.

Impact Assessment

The impact of CVE-2026-54522 is primarily characterized by information disclosure and data corruption. Because the custom slab allocator manages raw bytes rather than native Ruby objects directly, typical exploitation results in same-process data leaks rather than remote code execution.

In multi-tenant environments where a single Ruby worker process handles sequential sessions using a pooled buffer, an attacker can extract session keys, database records, and authentication tokens belonging to concurrent users. This breaks logical tenant boundaries at the database/application layer.

The stream corruption aspect also poses a integrity threat. An attacker can selectively inject corrupted serialized payloads into concurrent streams, causing downstream application exceptions, logic bypasses, or data storage corruption when the invalid payloads are deserialized and committed to databases.

Remediation and Mitigation

The primary and recommended remediation is to upgrade the msgpack gem to version 1.8.2 or later, which contains the fix that invalidates stale pointers upon buffer clearing.

If immediate patching is not possible, applications must be modified to eliminate buffer reuse patterns. Developers must instantiate a new MessagePack::Buffer object for each distinct serialization lifecycle rather than calling the #clear method on a shared instance.

# Vulnerable Pattern
@shared_buffer.clear
@shared_buffer.write(data)
 
# Mitigated Pattern (Temporary Workaround)
local_buffer = MessagePack::Buffer.new
local_buffer.write(data)

Standard deserialization endpoints, such as MessagePack.unpack(bytes), do not invoke this reuse code path and are not vulnerable to this memory aliasing flaw.

Fix Analysis (1)

Technical Appendix

CVSS Score
2.1/ 10
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

Affected Systems

Ruby applications utilizing the msgpack-ruby gem with persistent or pooled MessagePack::Buffer instances.

Affected Versions Detail

Product
Affected Versions
Fixed Version
msgpack-ruby
MessagePack
< 1.8.21.8.2
AttributeDetail
CWE IDCWE-416 (Use After Free)
Attack VectorLocal (AV:L)
CVSS v4.0 Score2.1 (Low)
Exploit StatusProof-of-Concept Available
ImpactInformation Disclosure / Stream Corruption
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1203Exploitation for Client Execution
Execution
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-416
Use After Free

Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute arbitrary code.

Known Exploits & Detection

GitHub Security AdvisoryIncludes a complete proof-of-concept demonstrating same-process use-after-free and cross-buffer disclosure via msgpack-ruby.

References & Sources

  • [1]GitHub Security Advisory GHSA-4mrv-5p47-p938
  • [2]Fix Commit 5627d71606b565641d2dd501b82aae862f4abe90
  • [3]Ruby Advisory Database Entry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-54722
8.7

CVE-2026-54722: Server-Side Request Forgery (SSRF) Bypass via Userinfo Stripping in dssrf-js

An SSRF validation bypass exists in dssrf-js (v1.0.3 and prior) due to an improper string normalization sequence inside is_url_safe. Before validating the host using Node's WHATWG parser, the helper strips the '@' symbol. This corrupts the parser's authority resolution, while the application's client requests the original, un-sanitized string containing internal IP targets.

Alon Barad
Alon Barad
2 views•6 min read
•about 3 hours ago•CVE-2026-67428
8.5

CVE-2026-67428: Server-Side Request Forgery in Flyto2 Core HTTP-Emitting Modules

Flyto2 Core (flyto-core) prior to version 2.26.7 did not utilize its centralized SSRF validation mechanism ('validate_url_with_env_config') across multiple HTTP-emitting modules. This oversight allowed low-privileged users executing automated workflows to perform Server-Side Request Forgery (SSRF) attacks against internal endpoints, loopback interfaces, and cloud provider metadata services.

Alon Barad
Alon Barad
5 views•5 min read
•about 4 hours ago•CVE-2026-67424
8.5

CVE-2026-67424: Server-Side Request Forgery Bypass via Unvalidated Redirects in Flyto2 Core

An SSRF vulnerability exists in Flyto2 Core due to improper validation of intermediate HTTP redirect hops. While the initial request target is validated against an SSRF protection policy, the HTTP client library (aiohttp) transparently follows 30x redirects to local, internal, or cloud metadata endpoints without application-level revalidation.

Alon Barad
Alon Barad
4 views•6 min read
•about 8 hours ago•GHSA-PC2W-4MQ8-32QW
6.5

GHSA-PC2W-4MQ8-32QW: Missing Human-Approval Gate in create_dynatrace_notebook

A logic vulnerability exists in @dynatrace-oss/dynatrace-mcp-server prior to version 1.8.7. The create_dynatrace_notebook tool lacks a human-approval gate, allowing an attacker to exploit indirect prompt injection to force the underlying LLM client to create persistent Dynatrace notebooks without the operator's consent.

Alon Barad
Alon Barad
5 views•8 min read
•about 9 hours ago•CVE-2026-50559
7.5

CVE-2026-50559: Authentication and Authorization Bypass via Parser Differential in Quarkus

A critical authentication and authorization bypass vulnerability in the Quarkus Java framework exists due to a parser differential mismatch between the HTTP security policy layer and downstream handlers. By leveraging encoded reserved characters such as semicolons, slashes, and backslashes, attackers can bypass configured path-based security policies to gain unauthorized access to secure administrative endpoints and static resources.

Alon Barad
Alon Barad
7 views•6 min read
•about 10 hours ago•CVE-2026-11393
9.0

CVE-2026-11393: Code Injection via Improper Triple-Quote Escaping in AWS AgentCore CLI

A critical code injection vulnerability exists in @aws/agentcore CLI (AWS AgentCore CLI) during the Bedrock Agent import lifecycle. An authenticated remote attacker with permissions to configure Bedrock collaborator attributes can inject python code by embedding triple-double-quotes (""") inside the collaborationInstruction metadata field. The CLI formats this metadata directly into a Python docstring in a generated main.py file without adequate escaping, leading to arbitrary code execution when the imported agent is run or deployed.

Alon Barad
Alon Barad
7 views•8 min read