Medium, CVSS 5.3crates.ioPublished
insert_slice_clone can double drop if Clone panics.
CVE-2021-26954 · GHSA-68p4-pjpf-xwcq
- Affected
- crates.io qwutils < 0.3.1
- Fixed in
- 0.3.1· Vendor fix available
- Issue
- Affected versions of this crate used ptr::copy when inserting into the middle of a Vec. When ownership was temporarily duplicated during this copy, it calls the clone method of a user provided element. This issue can result in an element being double-freed if the clone call panics. Commit 20cb73d fixed this issue by adding a setlen(0) call before operating on the vector to avoid dropping the elements during a panic.
Recommended action: Upgrade to 0.3.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.