{"id":"RUSTSEC-2025-0163","summary":"Unsound issue in Trailer","details":"Our static analyzer find a potential unsound issue\nin the construction of Trailer, where it doesn't\nprovide enough check to ensure the soundness.\n\ntrailer/src/lib.rs, Lines 18 to 25 in d474984:\n```\n pub fn new(capacity: usize) -\u003e Trailer\u003cT\u003e { \n     unsafe { \n         let trailer = Trailer::allocate(capacity); \n         let ptr = trailer.ptr as *mut T; \n         ptr.write(T::default()); \n         trailer \n     } \n } \n```\n\nThe constructor does not check the T is not a ZST in\nrust, and allocating with size 0 is considered\nas undefined behaviors in Rust. A poc code like\nbelow can work:\n\n```\nuse trailer::Trailer;\n#[derive(Default)]\nstruct Zst;\n\nfn main() {\n    let mut a = Trailer::\u003cZst\u003e::new(0);\n    drop(a);\n}\n```\n\nThe trailer crate is unmaintained and this security issue\nwill not be fixed.","aliases":["CVE-2025-47737","GHSA-6x45-r4pr-5362"],"modified":"2026-06-10T06:13:29Z","published":"2025-05-04T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/trailer"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2025-0163.html"},{"type":"REPORT","url":"https://github.com/Geal/trailer/issues/2"}],"affected":[{"package":{"name":"trailer","ecosystem":"crates.io","purl":"pkg:cargo/trailer"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}],"ecosystem_specific":{"affects":{"arch":[],"os":[],"functions":[]},"affected_functions":null},"database_specific":{"cvss":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0163.json","categories":[]}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"}]}