Add advisory for rkyv: panic safety in InlineVec::clear and SerVec::clear#2815
Add advisory for rkyv: panic safety in InlineVec::clear and SerVec::clear#2815tooson9010-spec wants to merge 10 commits intorustsec:mainfrom
Conversation
I'd like to better understand why this is -- maybe this doesn't need to be an advisory? |
|
@djc Thank you for raising this — it's a fair question, and I defer to your judgment on where the threshold should be. Let me briefly explain my reasoning, in case it's useful: My main reason for filing was that reaching memory unsafety from safe Rust is a soundness violation, which RustSec has historically treated as in-scope regardless of exploitability. I agree the CVSS is Medium at most (local, high AC, mostly availability), and I wasn't trying to frame it as critical — the maintainer's "not critical" wording matches my own assessment. One small nuance on reachability: That said, if this falls below the RustSec bar in your view, I'm very happy to close the PR — the maintainer's GHSA will still cover GitHub dependency alerts. Either way, thanks for taking the time to look, and your read here will help me calibrate for future reports. |
Yes, I'm trying to recalibrate what we consider in scope, see: (which as you'll note was written in response to earlier feedback from the rkyv maintainer). In this case, while the behavior is unsound, the setup conditions for this seem pretty hard to reach by accident -- catching a panic, then panicking in |
|
@djc That's very helpful context — thanks for pointing me to #2572. I agree the setup conditions here are hard to reach by accident, and I'll close this PR. The maintainer's GHSA will cover downstream alerts, which is likely sufficient for a bug of this shape. I'll take the criteria in #2572 into account going forward — much appreciate the thoughtful review. |
As far as I see, the RustSec maintainers who commented in #2572 agreed that, although panics are not worthy of advisories unless a crate's documentation says so, unsoundness is worthy of an advisory (with
Maybe this could be added only once |
|
Thanks again for all the patient guidance on this. I wanted to ask one more clarifying question, purely to calibrate my own understanding for future reports — please tell me if I'm missing something obvious. I noticed that RUSTSEC-2026-0103 was published just a few days ago (April 21), covering essentially the same pattern in
That one was accepted as a regular advisory (CVSS 7.3 High, CVE-2026-6654), not I don't want to relitigate the decision here — I'll follow whatever you think is right for this PR. But I'm genuinely trying to understand whether the distinction is about something specific to rkyv (e.g. less heap-owning usage in practice, or a different typical deployment shape), or whether the recalibration in #2572 is still in flux and RUSTSEC-2026-0103 was merged before the new bar was applied. Any pointer you can give would really help me calibrate for future disclosures — thanks again. |
My reviews are definitely not perfect, but I do think a material differerence here is that the thin-vec advisory affects what I'd consider the primary API -- implementations directly accessible via |
|
@djc I wanted to update you on additional research that significantly impacts Advanced analysis has confirmed that both rkyv issues can be exploited to I'd prefer to discuss the technical specifics privately, but I can confirm Would you be willing to reconsider the advisory based on confirmed code |
|
Yes, that sounds right. |
|
@djc Thank you! Just to confirm - does this mean you're now supportive I want to make sure I understand correctly before proceeding with the |
|
Yup -- please update the advisory, then we can merge it. And I'd like to receive the technical details in private -- my email address should be easy to find, or you can find me on the rust-lang Zulip or Discord. |
|
@djc Thank you for the approval! I've updated the advisory with the The advisory now includes:
I'll send you the detailed exploitation research via email as discussed. Ready for merge when you are! |
|
@bjorn3 Thank you for the detailed technical feedback. You're right about |
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
This advisory covers two panic-safety bugs in
rkyvv0.8.15:InlineVec::clear()(src/util/inline_vec.rs)SerVec::clear()(src/util/ser_vec.rs)Both functions update
self.lenonly afterdrop_in_place. If an element'sDroppanics,lenis left stale, and a subsequent invocation ofclear()(triggered byInlineVec::droporSerVec::with_capacity, respectively) re-visits already-freed memory. Both are reachable from safe Rust and result in double-free / heap-use-after-free, confirmed by AddressSanitizer and Miri.Disclosure
The maintainer (David Koloski) was notified privately by email and acknowledged the report. Both issues were fixed in v0.8.16. The maintainer also explicitly granted permission to disclose the issues publicly: