# GHSA-f85w-wvc7-crwc: bumpalo has use-after-free due to a lifetime error in `Vec::into_iter()`

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-01-14T12:00:00.000Z
- Modified: 2026-09-10T03:49:51.242Z
- Also known as: RUSTSEC-2022-0078

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- bumpalo (crates.io): from 1.1.0 before 3.11.1

## References

- <https://github.com/fitzgen/bumpalo> (package)
- <https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md#3111> (web)
- <https://rustsec.org/advisories/RUSTSEC-2022-0078.html> (advisory, web)
- <https://crates.io/crates/bumpalo> (package)

## Sources

- GitHub Advisory Database: [GHSA-f85w-wvc7-crwc](https://github.com/advisories/GHSA-f85w-wvc7-crwc), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2022-0078](https://rustsec.org/advisories/RUSTSEC-2022-0078.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-f85w-wvc7-crwc · Whole record: https://cve.day/GHSA-f85w-wvc7-crwc.json · Rebuilt by cve.day 2026-11-25T22:56:43.120Z
