GHSA-f85w-wvc7-crwc: Bumpalo :into_iter()` Vulnerability

MODERATE
Published
Advisory Summary

GHSA-f85w-wvc7-crwc is a MODERATE :into_iter()` vulnerability (General Security Weakness) affecting Bumpalo libraries in the crates.io ecosystem. The issue involves :into_iter()`. Remediation is available by upgrading affected packages to version 3.11.1.

GHSA-f85w-wvc7-crwc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f85w-wvc7-crwc
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Bumpalo
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-f85w-wvc7-crwc

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

bumpalo fixed: 3.11.1
Upgrade bumpalo to 3.11.1
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 bumpalo

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f85w-wvc7-crwc, inspect your project dependencies for Bumpalo:

inspect dependencies for bumpalo

Analyze the terminal output to locate any version of Bumpalo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.1), 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 General Security Weakness. In Bumpalo, 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

In affected versions of this crate, the lifetime of the iterator produced by `Vec::into_iter()` is not constrained to the lifetime of the `Bump` that allocated the vector's memory. Using the iterator after the `Bump` is dropped causes use-after-free accesses. The following example demonstrates memory corruption arising from a misuse of this unsoundness. ```rust use bumpalo::{collections::Vec, Bump}; fn main() { let bump = Bump::new(); let mut vec = Vec::new_in(&bump); vec.extend([0x01u8; 32]); let into_iter = vec.into_iter(); drop(bump); for _ in 0..100 { let reuse_bump = Bump::new(); let _reuse_alloc = reuse_bump.alloc([0x41u8; 10]); } for x in into_iter { print!("0x{:02x} ", x); } println!(); } ``` The issue was corrected in version 3.11.1 by adding a lifetime to the `IntoIter` type, and updating the signature of `Vec::into_iter()` to constrain this lifetime.

GHSA-f85w-wvc7-crwc Affected Bumpalo Versions

1 component(s)
Fixed Versions:
3.11.1
Product / Package Ecosystem Affected Versions Fixed Version
bumpalo
crates.io
≥ 1.1.0
< 3.11.1
3.11.1

References

Frequently Asked Questions

What is GHSA-f85w-wvc7-crwc?
GHSA-f85w-wvc7-crwc is a security vulnerability in Bumpalo involving :into_iter()` under General Security Weakness.
Which Bumpalo versions are affected?
Affected versions include releases prior to 3.11.1 across affected packages: bumpalo.
What version fixes GHSA-f85w-wvc7-crwc?
Upgrading to 3.11.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bumpalo affected?
Yes, bumpalo is affected in releases prior to 3.11.1. Upgrade your dependency to 3.11.1 or later.
What CWE is associated with GHSA-f85w-wvc7-crwc?
GHSA-f85w-wvc7-crwc is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-f85w-wvc7-crwc?
Run the dependency tree command: 'inspect dependencies for bumpalo'. 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-f85w-wvc7-crwc",
  "modified" : "2023-01-20T21:54:22Z",
  "published" : "2023-01-20T21:54:22Z",
  "aliases" : [ ],
  "summary" : "bumpalo has use-after-free due to a lifetime error in `Vec::into_iter()`",
  "details" : "In affected versions of this crate, the lifetime of the iterator produced by `Vec::into_iter()` is not constrained to the lifetime of the `Bump` that allocated the vector's memory. Using the iterator after the `Bump` is dropped causes use-after-free accesses.\n\nThe following example demonstrates memory corruption arising from a misuse of this unsoundness.\n\n```rust\nuse bumpalo::{collections::Vec, Bump};\n\nfn main() {\n    let bump = Bump::new();\n    let mut vec = Vec::new_in(&bump);\n    vec.extend([0x01u8; 32]);\n    let into_iter = vec.into_iter();\n    drop(bump);\n\n    for _ in 0..100 {\n        let reuse_bump = Bump::new();\n        let _reuse_alloc = reuse_bump.alloc([0x41u8; 10]);\n    }\n\n    for x in into_iter {\n        print!(\"0x{:02x} \", x);\n    }\n    println!();\n}\n```\n\nThe issue was corrected in version 3.11.1 by adding a lifetime to the `IntoIter` type, and updating the signature of `Vec::into_iter()` to constrain this lifetime.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "bumpalo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.1.0"
      }, {
        "fixed" : "3.11.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "PACKAGE",
    "url" : "https://github.com/fitzgen/bumpalo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md#3111"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0078.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-20T21:54:22Z",
    "nvd_published_at" : null
  }
}