{"id":"GHSA-vfvv-c25p-m7mm","aliases":["RUSTSEC-2026-0122"],"url":"https://o3.security/vulnerability/GHSA-vfvv-c25p-m7mm","summary":"rkyv: Panic safety bugs in `InlineVec::clear` and `SerVec::clear` enable arbitrary code execution","details":"`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.","published":"2026-05-15T18:09:10Z","modified":"2026-05-18T04:44:19.613604410Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"crates.io","name":"rkyv","fixedVersion":"0.8.16"}],"fix":{"url":"https://github.com/rkyv/rkyv/commit/5828cf5c27b664eb4432c4a93d4769e12e5e42fb","label":"rkyv/rkyv@5828cf5"},"references":[{"type":"WEB","url":"https://github.com/rkyv/rkyv/commit/5828cf5c27b664eb4432c4a93d4769e12e5e42fb"},{"type":"PACKAGE","url":"https://github.com/rkyv/rkyv"},{"type":"WEB","url":"https://rustsec.org/advisories/RUSTSEC-2026-0122.html"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-05-18T04:44:19.613604410Z"}}