Files
advisory-db/packages/trailer.json
T
2026-06-10 06:13:45 +00:00

70 lines
2.3 KiB
JSON

[
{
"id": "RUSTSEC-2025-0163",
"modified": "2026-06-10T06:13:29Z",
"published": "2025-05-04T12:00:00Z",
"aliases": [
"CVE-2025-47737",
"GHSA-6x45-r4pr-5362"
],
"related": [],
"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.",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
}
],
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "trailer",
"purl": "pkg:cargo/trailer"
},
"ecosystem_specific": {
"affects": {
"arch": [],
"os": [],
"functions": []
},
"affected_functions": null
},
"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
},
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
}
]
}
],
"versions": []
}
],
"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"
}
}
]