{"id":"RUSTSEC-2026-0598","aliases":[],"title":"`hugepage_rs::alloc` may cause undefined behavior with zero-sized layouts from safe code","titleSource":"OSV","descriptionSource":"OSV","description":"`hugepage_rs::alloc` was a publicly accessible safe function that forwarded a `Layout` to the hugepage allocator's `GlobalAlloc::alloc` implementation without enforcing its safety requirements.\n`GlobalAlloc::alloc` requires the layout size to be non-zero. However, the safe wrapper allowed callers to pass a zero-sized `Layout`, violating this precondition without using `unsafe`.\nAffected versions therefore exposed an unsafe allocation precondition through safe Rust code, violating Rust's soundness guarantees.\n\nThe upstream repository fixed this in version `0.1.2` by marking `alloc` as unsafe and documenting its non-zero-layout requirement.","severity":"unknown","score":null,"published":"2026-10-27T12:00:00.000Z","modified":"2026-11-24T09:30:02.332Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"crates.io","name":"hugepage-rs","sources":[{"name":"OSV · RUSTSEC-2026-0598","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0598"}],"ranges":[{"events":[{"introduced":"0.0.0-0"},{"fixed":"0.1.2"}],"type":"SEMVER"}],"versions":[],"fixed":["0.1.2"]}],"sourceAffected":[],"references":["https://crates.io/crates/hugepage-rs","https://rustsec.org/advisories/RUSTSEC-2026-0598.html","https://github.com/cppcoffee/hugepage-rs/issues/7","https://github.com/cppcoffee/hugepage-rs/pull/8","https://github.com/cppcoffee/hugepage-rs/releases/tag/v0.1.2"],"sources":[{"name":"OSV","id":"RUSTSEC-2026-0598","modified":"2026-11-24T09:30:02.332816519Z","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0598"}],"assessments":[],"products":[],"remediation":[],"observedAt":"2026-11-24T10:00:59.210Z","kev":{"status":"unavailable","checkedAt":"2026-11-29T00:05:30.113Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[],"aiSummary":null}