GHSA-q95x-7g78-rccv: Oneringbuf OneRingBuf Has A Use After Vulnerability

MODERATE
CWE-416
Published
Advisory Summary

GHSA-q95x-7g78-rccv is a MODERATE oneringbuf has a use after vulnerability (CWE-416: Use After Free) affecting Oneringbuf libraries in the crates.io ecosystem. The issue involves oneringbuf has a use after free vulnerability. Remediation is available by upgrading affected packages to version 0.8.0.

GHSA-q95x-7g78-rccv at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q95x-7g78-rccv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-416: Use After Free
Affected Product Oneringbuf
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-q95x-7g78-rccv

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

oneringbuf fixed: 0.8.0
Upgrade oneringbuf to 0.8.0
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 oneringbuf

How to Check if You Are Affected

To determine whether your application is affected by GHSA-q95x-7g78-rccv, inspect your project dependencies for Oneringbuf:

inspect dependencies for oneringbuf

Analyze the terminal output to locate any version of Oneringbuf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.0), 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-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Oneringbuf, 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

Affected versions of `oneringbuf` exposed the obsolete `IntoRef::into_ref` method through the public `IntoRef` trait. For heap-backed ring buffers, this method returned a `DroppableRef` handle. `DroppableRef` stored an owning raw pointer created from `Box::into_raw`. Its `Clone` implementation copied this raw pointer without incrementing the internal `alive_iters` counter. Internally, this clone pattern appears to rely on a fixed number of handles being created to match the initial `alive_iters` value. However, exposing `DroppableRef` through the public `IntoRef::TargetRef` associated type allows safe external code to create additional clones beyond that fixed count, breaking the lifetime protocol. `Drop` later dereferenced the pointer and could free the backing allocation with `Box::from_raw`. Safe code could call `IntoRef::into_ref` to obtain a `DroppableRef` and then clone it. Each clone pointed to the same allocation, but the internal `alive_iters` counter was not increased. As a result, one clone could free the allocation while another clone still existed. Dropping the remaining clone then accessed freed memory, causing a heap-use-after-free. The issue was fixed in version 0.8.0 by removing the obsolete `into_ref` method. ## Trigger ```rust use oneringbuf::{IntoRef, LocalHeapRB}; fn main() { let rb = LocalHeapRB::<usize>::from(vec![1, 2, 3]); let r = <LocalHeapRB<usize> as IntoRef>::into_ref(rb); let r2 = r.clone(); let r3 = r.clone(); drop(r); drop(r2); drop(r3); // AddressSanitizer: heap-use-after-free } ```

GHSA-q95x-7g78-rccv Affected Oneringbuf Versions

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

References

Frequently Asked Questions

What is GHSA-q95x-7g78-rccv?
GHSA-q95x-7g78-rccv is a security vulnerability in Oneringbuf involving OneRingBuf has a Use After Free Vulnerability under CWE-416: Use After Free.
Which Oneringbuf versions are affected?
Affected versions include releases prior to 0.8.0 across affected packages: oneringbuf.
What version fixes GHSA-q95x-7g78-rccv?
Upgrading to 0.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is oneringbuf affected?
Yes, oneringbuf is affected in releases prior to 0.8.0. Upgrade your dependency to 0.8.0 or later.
What CWE is associated with GHSA-q95x-7g78-rccv?
GHSA-q95x-7g78-rccv is classified under CWE-416: Use After Free (The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.).
How can I check crates.io dependencies for GHSA-q95x-7g78-rccv?
Run the dependency tree command: 'inspect dependencies for oneringbuf'. 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-q95x-7g78-rccv",
  "modified" : "2026-07-08T20:26:23Z",
  "published" : "2026-07-08T20:26:23Z",
  "aliases" : [ ],
  "summary" : "OneRingBuf has a Use After Free Vulnerability",
  "details" : "Affected versions of `oneringbuf` exposed the obsolete `IntoRef::into_ref` method through the public `IntoRef` trait. For heap-backed ring buffers, this method returned a `DroppableRef` handle.\n\n`DroppableRef` stored an owning raw pointer created from `Box::into_raw`. Its `Clone` implementation copied this raw pointer without incrementing the internal `alive_iters` counter. Internally, this clone pattern appears to rely on a fixed number of handles being created to match the initial `alive_iters` value. However, exposing `DroppableRef` through the public `IntoRef::TargetRef` associated type allows safe external code to create additional clones beyond that fixed count, breaking the lifetime protocol. `Drop` later dereferenced the pointer and could free the backing allocation with `Box::from_raw`.\n\nSafe code could call `IntoRef::into_ref` to obtain a `DroppableRef` and then clone it. Each clone pointed to the same allocation, but the internal `alive_iters` counter was not increased. As a result, one clone could free the allocation while another clone still existed. Dropping the remaining clone then accessed freed memory, causing a heap-use-after-free.\n\nThe issue was fixed in version 0.8.0 by removing the obsolete `into_ref` method.\n\n## Trigger\n\n```rust\nuse oneringbuf::{IntoRef, LocalHeapRB};\n\nfn main() {\n    let rb = LocalHeapRB::<usize>::from(vec![1, 2, 3]);\n\n    let r = <LocalHeapRB<usize> as IntoRef>::into_ref(rb);\n    let r2 = r.clone();\n    let r3 = r.clone();\n\n    drop(r);\n    drop(r2);\n    drop(r3); // AddressSanitizer: heap-use-after-free\n}\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "oneringbuf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/skilvingr/rust-oneringbuf/commit/643a24b30914068416dff9021a069c12c865a316"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Skilvingr/rust-oneringbuf"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0152.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-416" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-08T20:26:23Z",
    "nvd_published_at" : null
  }
}