RUSTSEC-2025-0163

vendorUSosv

Unsound issue in Trailer

view advisory published 2025-05-04Licence: CC0-1.0

Our static analyzer find a potential unsound issue in the construction of Trailer, where it doesn't provide enough check to ensure the soundness. trailer/src/lib.rs, Lines 18 to 25 in d474984: ``` pub fn new(capacity: usize) -> Trailer<T> { unsafe { let trailer = Trailer::allocate(capacity); let ptr = trailer.ptr as *mut T; ptr.write(T::default()); trailer } } ``` The constructor does not check the T is not a ZST in rust, and allocating with size 0 is considered as undefined behaviors in Rust. A poc code like below can work: ``` use trailer::Trailer; #[derive(Default)] struct Zst; fn main() { let mut a = Trailer::<Zst>::new(0); drop(a); } ``` The trailer crate is unmaintained and this security issue will not be fixed.

01

describes (1)

Related CVEs.

IDseverity exploitable
CVE-2025-47737UScritical9.8—
lib.rs in the trailer crate through 0.1.2 for Rust mishandles allocating with a size of zero.
02

references

External citations — patches, advisories, analysis.

scry

Advisories like this name the exposed products attackers go after on your perimeter. See what is exposed on your perimeter with a free passive scan.

Free scan