{"id":"GHSA-vfvv-c25p-m7mm","revision":"21a9c84bb1b241519d700cb3e2e875e5","records":[{"revision":"21a9c84bb1b241519d700cb3e2e875e5","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-vfvv-c25p-m7mm","aliases":["RUSTSEC-2026-0122"],"title":"rkyv: Panic safety bugs in `InlineVec::clear` and `SerVec::clear` enable arbitrary code execution","description":"`InlineVec::clear()` and `SerVec::clear()` in `rkyv` were not panic-safe. Both functions iterate over their elements and call `drop_in_place` on each, updating `self.len` only *after* the loop. If an element's `Drop` implementation panics during the loop, `self.len` is left at its original value.\n\nA subsequent invocation of `clear()` on the same container then re-visits the already-freed elements:\n\n- `InlineVec::clear()` is called again from `InlineVec`'s own `Drop` implementation when the value is later dropped.\n- `SerVec::clear()` is called again by `SerVec::with_capacity()` after the  user closure returns.\n\n\n## Technical Impact\n\n- **CWE-415 (Double Free):** Heap corruption when element type holds `Box<T>`  \n- **CWE-416 (Use-After-Free):** Memory corruption when element reads from heap during `Drop`\n\nBoth vulnerabilities are triggerable entirely from safe Rust via `std::panic::catch_unwind` and require no special privileges.","state":0,"publishedAt":"2026-05-15T18:09:10+00:00","modifiedAt":"2026-09-10T03:50:47.7141442+00:00","affected":[{"ecosystem":"crates.io","name":"rkyv","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.8.0"},{"kind":"fixed","version":"0.8.16"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/rkyv/rkyv/commit/5828cf5c27b664eb4432c4a93d4769e12e5e42fb","https://github.com/rkyv/rkyv","https://rustsec.org/advisories/RUSTSEC-2026-0122.html"],"sourceUrl":"https://github.com/advisories/GHSA-vfvv-c25p-m7mm","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-vfvv-c25p-m7mm","identifiers":["GHSA-vfvv-c25p-m7mm","RUSTSEC-2026-0122"]},"retained":false,"historicalAffected":[]}],"coverage":[]}