bumpalo has use-after-free due to a lifetime error in `Vec::into_iter()`
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | bumpalo (crates.io) | 1.1.0 to before 3.11.1 | 3.11.1 | Patch available | GHSA-f85w-wvc7-crwc |
- bumpalo (crates.io) Vendor— Affected 1.1.0 to before 3.11.1 Fixed in 3.11.1 Patch available GHSA-f85w-wvc7-crwc
Remediation
- Fix · GHSA-f85w-wvc7-crwc bumpalo (crates.io) Fixed in 3.11.1 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-f85w-wvc7-crwc
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences