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



GHSA-VFVV-C25P-M7MM

GHSA-VFVV-C25P-M7MM: Memory Corruption via Panic Safety Flaw in rkyv Collections

Alon Barad
Alon Barad
Software Engineer

May 15, 2026·5 min read·57 visits

Executive Summary (TL;DR)

A panic safety bug in rkyv's `InlineVec::clear` and `SerVec::clear` methods leads to Use-After-Free and Double Free conditions if element destructors panic. Upgrading to 0.8.16 resolves the issue by updating container state before initiating destructors.

The rkyv zero-copy deserialization framework for Rust suffers from a panic safety vulnerability in its manual memory management logic. The flaw allows memory corruption, specifically Double Free and Use-After-Free, when element destructors panic during vector clearance.

Vulnerability Overview

The rkyv library is a zero-copy deserialization framework for Rust. It provides custom vector implementations, specifically InlineVec and SerVec, to manage memory during serialization and deserialization processes. These collections handle memory allocations and deallocations manually to optimize performance.

A vulnerability tracked as GHSA-VFVV-C25P-M7MM and RUSTSEC-2026-0122 exists in the memory management logic of these custom collections. The issue stems from a lack of panic safety during the execution of element destructors. The vulnerability affects rkyv versions strictly greater than or equal to 0.8.0 and less than 0.8.16.

When an element's Drop implementation panics during a call to the clear method, the container's internal length field remains unaltered. This discrepancy between the logical state and the physical memory state leads to undefined behavior. The vulnerability exposes applications to memory corruption risks, primarily Use-After-Free and Double Free conditions.

Root Cause Analysis

The root cause lies in the sequencing of operations within the InlineVec::clear and SerVec::clear functions. These functions are responsible for deallocating the objects held within the collections by iterating over them and invoking drop_in_place. This function runs the destructors for the allocated memory regions.

In the vulnerable design, the collections wait for the iteration loop to complete successfully before resetting their internal len fields to zero. This approach assumes that destructors will never panic, which violates strict Rust panic safety guarantees. The length update is executed as the final step of the function block.

If a panic occurs while processing an element, normal control flow is interrupted by unwinding. The loop terminates prematurely, and the function's final length assignment is bypassed entirely. The container exits the function execution prematurely but maintains its previous state.

Because the length field is not decremented, the collection struct retains logical ownership over the entire original array of objects. Elements that were successfully destroyed prior to the panic are still considered active members of the vector, leading to dangling pointers within the container's accessible range.

Code Analysis

The flawed logic is visible in the vulnerable implementation of the clear method. The function iterates through the allocated elements and drops them sequentially. The critical length update is positioned at the very end of the function body, leaving a window for panic unwinding to bypass the state update.

// VULNERABLE CODE (Simplified)
pub fn clear(&mut self) {
    for i in 0..self.len {
        unsafe {
            self.elements[i].as_mut_ptr().drop_in_place();
        }
    }
    // State is updated AFTER the potentially panicking loop
    self.len = 0; 
}

The fix implemented in commit 5828cf5c27b664eb4432c4a93d4769e12e5e42fb adopts the "Commit Before Side-Effect" design pattern. The length field is stored locally and immediately zeroed out before any destructors are invoked. This ensures the container reflects an empty state prior to executing arbitrary Drop code.

// PATCHED CODE (Simplified)
pub fn clear(&mut self) {
    let len = self.len;
    // State is committed BEFORE the side-effect operations
    self.len = 0; 
 
    for i in 0..len {
        unsafe {
            self.elements[i].as_mut_ptr().drop_in_place();
        }
    }
}

By separating the state update from the side-effecting operations, the function ensures the collection remains consistent even during unwinding. Any subsequent attempts to access or drop the vector will perceive it as empty, completely mitigating the double-free condition.

Exploitation Mechanics

Exploitation requires a specific program state where an attacker controls the data types being managed by rkyv or can intentionally trigger a panic within a custom Drop implementation. The vulnerability triggers undefined behavior via two primary mechanisms during the unwinding phase. Both mechanisms require the application to process complex types with panicking destructors.

The first mechanism is a Double Free condition (CWE-415). If the unwinding process subsequently drops the InlineVec or SerVec container itself, the container's destructor will re-iterate over the full length of the vector. The unmodified length field directs the program to drop the entire collection array again.

During this second iteration, the system re-invokes destructors on the memory regions that were already freed before the initial panic occurred. This double invocation results in heap corruption that can crash the application or facilitate arbitrary code execution depending on the underlying allocator.

The second mechanism is a Use-After-Free condition (CWE-416). This occurs if the application catches the panic using the std::panic::catch_unwind facility and resumes standard execution. The program regains access to the original vector, whose length field falsely advertises the presence of valid elements. Accessing elements at the lower indices references the deallocated memory.

Remediation and Mitigation

The maintainers resolved the vulnerability in rkyv version 0.8.16. Organizations utilizing this crate must upgrade their dependencies to incorporate the panic-safe memory management logic. Updating the package strictly removes the flaw without requiring architectural changes to consumer applications.

Software engineers developing custom memory allocators or containers in Rust must adhere strictly to panic safety principles. State changes that govern memory ownership must be finalized before invoking user-controlled code. This "Commit Before Side-Effect" pattern is mandatory for safe unsafe-code encapsulation.

Developers should review custom implementations of functions like clear, truncate, and pop. The internal length and capacity fields must accurately reflect the memory state prior to executing drop_in_place. Manual drops inside a loop require extreme caution regarding how unwinding behaves at each step.

To detect similar flaws, security teams can leverage dynamic analysis tools such as Miri. Executing test suites with Miri enabled and intentionally introducing panicking destructors will rapidly expose inconsistent memory states and dangling pointers.

Official Patches

rkyv developersOfficial patch commit

Fix Analysis (1)

Technical Appendix

CVSS Score
High (Unscored)/ 10

Affected Systems

Rust applications dependent on rkyv versions >= 0.8.0 and < 0.8.16 utilizing InlineVec or SerVec

Affected Versions Detail

Product
Affected Versions
Fixed Version
rkyv
rkyv developers
>= 0.8.0, < 0.8.160.8.16
AttributeDetail
CWE IDCWE-415 / CWE-416
Attack VectorLocal / Application-Level
ImpactMemory Corruption / Denial of Service
Exploit StatusProof of Concept
KEV StatusNot Listed
CVSSHigh (Unscored)

MITRE ATT&CK Mapping

T1211Exploitation for Privilege Escalation
Privilege Escalation
T1499.004Endpoint Denial of Service: Application Exhaustion
Impact
CWE-415
Double Free

Vulnerability Timeline

Vulnerability Reported
2026-04-23
Advisory Issued and Patch Available
2026-05-11

References & Sources

  • [1]GitHub Security Advisory: GHSA-VFVV-C25P-M7MM
  • [2]RustSec Advisory Database: RUSTSEC-2026-0122
  • [3]OSV Data for RUSTSEC-2026-0122

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

•26 minutes ago•CVE-2026-105743
4.0

CVE-2026-105743: Server-Side Request Forgery Guard Bypass in Docling Document Conversion Engine

An SSRF guard bypass vulnerability in the Docling document conversion engine allows unauthenticated attackers to bypass internal IP access controls. The vulnerability exists due to a DNS rebinding Time-of-Check Time-of-Use (TOCTOU) condition, URL authority parsing inconsistencies, and unvalidated network requests triggered during headless browser page rendering.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 1 hour ago•CVE-2026-105742
3.7

CVE-2026-105742: Sensitive Custom Header Leakage in Docling Image Resource Loader

A technical analysis of CVE-2026-105742 (GHSA-p3fw-7699-7926), a sensitive information disclosure vulnerability in the Docling document processing library. Vulnerable versions of Docling indiscriminately forward custom HTTP headers, such as authentication tokens, to arbitrary third-party origins and during cross-origin redirects while fetching remote image assets from untrusted HTML and EPUB documents.

Alon Barad
Alon Barad
4 views•6 min read
•about 2 hours ago•CVE-2026-106121
4.9

CVE-2026-106121: Denial of Service via Infinite Loop in RabbitMQ Java Client JSON Parser

CVE-2026-106121 is a Denial of Service (DoS) vulnerability in the RabbitMQ Java Client library (amqp-client) affecting versions prior to 5.37.0. The vulnerability resides in the legacy, custom JSON-RPC parsing class com.rabbitmq.tools.json.JSONReader. When parsing malformed or truncated payloads ending within a quoted string or single-line comment, the parser's scanner enters an infinite loop. This occurs because the loop lacks an exit condition for the end-of-input sentinel character returned by the iterator, leading to either CPU exhaustion or a JVM crash from an OutOfMemoryError.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 4 hours ago•CVE-2026-105646
4.9

CVE-2026-105646: Regular Expression Denial of Service in Ghost CMS Import Handlers

An authenticated Regular Expression Denial of Service (ReDoS) vulnerability in TryGhost Ghost (CMS) versions 4.0.0 through 6.66.x. An attacker with administrator privileges can upload crafted content import archives containing pathological directory names or migration patterns, triggering exponential backtracking in the Node.js V8 engine.

Alon Barad
Alon Barad
8 views•6 min read
•about 5 hours ago•CVE-2026-105645
4.9

CVE-2026-105645: Regular Expression Denial of Service (ReDoS) in Ghost CMS

CVE-2026-105645 is a regular expression denial of service (ReDoS) vulnerability affecting Ghost, an open-source Node.js content management system. The vulnerability exists within directory import handlers and the external media inliner, allowing authenticated administrators to trigger catastrophic backtracking in the V8 JavaScript engine, resulting in infinite loops, 100% CPU utilization, and total denial of service.

Amit Schendel
Amit Schendel
8 views•6 min read
•about 6 hours ago•CVE-2026-105644
6.8

CVE-2026-105644: Stored Cross-Site Scripting via Malicious SVG Content Import in Ghost CMS

A Stored Cross-Site Scripting (XSS) and Unrestricted Upload of File with Dangerous Type vulnerability in Ghost CMS (versions 4.0.0 to 6.66.x) allows remote attackers to execute arbitrary JavaScript in the context of an administrator's session. The flaw lies in the content import subsystem, which extracted and stored SVG files without sanitization or binary verification.

Amit Schendel
Amit Schendel
7 views•6 min read