CVE-2021-26954
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
qwutils (crates.io)before 0.3.1, from 0.0.0-0 before 0.3.1GitHub Advisory Database, RustSec Advisory Database
qwutils_project qwutilsbefore 0.3.1NVD

All scores

GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
RustSec Advisory Database5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.0medium CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-26954 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-68p4-pjpf-xwcq changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0018 changed 2023-11-08CC0-1.0
NVDCVE-2021-26954 changed 2026-06-17Public domain