Advisory

RUSTSEC-2025-0163

Also known as: CVE-2025-47737, GHSA-6x45-r4pr-5362

Summary

Unsound issue in Trailer

Details

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.

Severity

Low Basis: CVSS v3 score 2.9, vector CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

Dates

Published
2025-05-04 12:00 UTC
Modified
2026-06-10 06:13 UTC

Affected packages and fixes

trailer

crates.io · All systems

Affected

  • introduced 0.0.0-0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences