Files
vuln-osv/data/crates.io/RUSTSEC-2025-0163.json

1 line
1.8 KiB
JSON

{"schema_version":"1.7.5","id":"RUSTSEC-2025-0163","published":"2025-05-04T12:00:00Z","modified":"2026-06-10T06:13:29Z","aliases":["CVE-2025-47737","GHSA-6x45-r4pr-5362"],"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) -> Trailer<T> { \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::<Zst>::new(0);\n drop(a);\n}\n```\n\nThe trailer crate is unmaintained and this security issue\nwill not be fixed.","affected":[{"package":{"name":"trailer","ecosystem":"crates.io","purl":"pkg:cargo/trailer"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":[],"os":[]}},"database_specific":{"categories":[],"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"}}],"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"}],"database_specific":{"license":"CC0-1.0"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"}]}