GHSA-vfvv-c25p-m7mm: rkyv Panic Safety Bugs Vulnerability

MODERATE
CWE-415 CWE-416
Published
Advisory Summary

GHSA-vfvv-c25p-m7mm is a MODERATE panic safety bugs vulnerability (CWE-415: Double Free) affecting rkyv libraries in the crates.io ecosystem. The issue involves panic safety bugs in `inlinevec::clear` and `servec::clear` enable arbitrary code execution. Remediation is available by upgrading affected packages to version 0.8.16.

GHSA-vfvv-c25p-m7mm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vfvv-c25p-m7mm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-415: Double Free
Affected Product rkyv
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-vfvv-c25p-m7mm

To remediate this vulnerability, upgrade all affected rkyv dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rkyv fixed: 0.8.16
Upgrade rkyv to 0.8.16
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rkyv

How to Check if You Are Affected

To determine whether your application is affected by GHSA-vfvv-c25p-m7mm, inspect your project dependencies for rkyv:

inspect dependencies for rkyv

Analyze the terminal output to locate any version of rkyv in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.16), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-415: Double Free, where the product calls free() twice on the same memory address. In rkyv, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

`InlineVec::clear()` and `SerVec::clear()` in `rkyv` were not panic-safe. Both functions iterate over their elements and call `drop_in_place` on each, updating `self.len` only *after* the loop. If an element's `Drop` implementation panics during the loop, `self.len` is left at its original value. A subsequent invocation of `clear()` on the same container then re-visits the already-freed elements: - `InlineVec::clear()` is called again from `InlineVec`'s own `Drop` implementation when the value is later dropped. - `SerVec::clear()` is called again by `SerVec::with_capacity()` after the user closure returns. ## Technical Impact - **CWE-415 (Double Free):** Heap corruption when element type holds `Box<T>` - **CWE-416 (Use-After-Free):** Memory corruption when element reads from heap during `Drop` Both vulnerabilities are triggerable entirely from safe Rust via `std::panic::catch_unwind` and require no special privileges.

GHSA-vfvv-c25p-m7mm Affected rkyv Versions

1 component(s)
Fixed Versions:
0.8.16
Product / Package Ecosystem Affected Versions Fixed Version
rkyv
crates.io
≥ 0.8.0
< 0.8.16
0.8.16

References

Frequently Asked Questions

What is GHSA-vfvv-c25p-m7mm?
GHSA-vfvv-c25p-m7mm is a security vulnerability in rkyv involving Panic safety bugs in `InlineVec::clear` and `SerVec::clear` enable arbitrary code execution under CWE-415: Double Free.
Which rkyv versions are affected?
Affected versions include releases prior to 0.8.16 across affected packages: rkyv.
What version fixes GHSA-vfvv-c25p-m7mm?
Upgrading to 0.8.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rkyv affected?
Yes, rkyv is affected in releases prior to 0.8.16. Upgrade your dependency to 0.8.16 or later.
What CWE is associated with GHSA-vfvv-c25p-m7mm?
GHSA-vfvv-c25p-m7mm is classified under CWE-415: Double Free (The product calls free() twice on the same memory address.).
How can I check crates.io dependencies for GHSA-vfvv-c25p-m7mm?
Run the dependency tree command: 'inspect dependencies for rkyv'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vfvv-c25p-m7mm",
  "modified" : "2026-05-15T18:09:10Z",
  "published" : "2026-05-15T18:09:10Z",
  "aliases" : [ ],
  "summary" : "rkyv: Panic safety bugs in `InlineVec::clear` and `SerVec::clear` enable arbitrary code execution",
  "details" : "`InlineVec::clear()` and `SerVec::clear()` in `rkyv` were not panic-safe. Both functions iterate over their elements and call `drop_in_place` on each, updating `self.len` only *after* the loop. If an element's `Drop` implementation panics during the loop, `self.len` is left at its original value.\n\nA subsequent invocation of `clear()` on the same container then re-visits the already-freed elements:\n\n- `InlineVec::clear()` is called again from `InlineVec`'s own `Drop` implementation when the value is later dropped.\n- `SerVec::clear()` is called again by `SerVec::with_capacity()` after the  user closure returns.\n\n\n## Technical Impact\n\n- **CWE-415 (Double Free):** Heap corruption when element type holds `Box<T>`  \n- **CWE-416 (Use-After-Free):** Memory corruption when element reads from heap during `Drop`\n\nBoth vulnerabilities are triggerable entirely from safe Rust via `std::panic::catch_unwind` and require no special privileges.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "rkyv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.0"
      }, {
        "fixed" : "0.8.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rkyv/rkyv/commit/5828cf5c27b664eb4432c4a93d4769e12e5e42fb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rkyv/rkyv"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0122.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-415", "CWE-416" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-15T18:09:10Z",
    "nvd_published_at" : null
  }
}