5.3medium
insert_slice_clone can double drop if Clone panics.
- Severity
- 5.3medium CVSS:3.1 by NVD
- Exploit likelihood
- 1.38% (higher than 72% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-68p4-pjpf-xwcqRUSTSEC-2021-0018
Description
An issue was discovered in the qwutils crate before 0.3.1 for Rust. When a Clone panic occurs, insert_slice_clone can perform a double drop.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| qwutils (crates.io) | before 0.3.1, from 0.0.0-0 before 0.3.1 | GitHub Advisory Database, RustSec Advisory Database |
| qwutils_project qwutils | before 0.3.1 | NVD |
All scores
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| RustSec Advisory Database | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
An issue was discovered in the qwutils crate before 0.3.1 for Rust. When a Clone panic occurs, insert_slice_clone can perform a double drop.
GitHub Advisory Database
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 set_len(0) call before operating on the vector to avoid dropping the elements during a panic.
RustSec Advisory Database
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 set_len(0) call before
operating on the vector to avoid dropping the elements during a panic.
NVD (es)
Se detectó un problema en la crate qwutils versiones anteriores a 0.3.1 para Rust. Cuando ocurre un pánico de Clone, la función insert_slice_clone puede llevar a cabo una doble caída
References
| https://rustsec.org/advisories/RUSTSEC-2021-0018.html | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-26954 | advisory | |
| https://github.com/qwertz19281/rust_utils/issues/3 | report, web | |
| https://github.com/qwertz19281/rust_utils/commit/20cb73d | web | |
| https://github.com/qwertz19281/rust_utils | package | |
| https://crates.io/crates/qwutils | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-26954 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-68p4-pjpf-xwcq changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0018 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-26954 changed 2026-06-17 | Public domain |