CVE-2021-26954: Qwutils Insert_slice_clone Can Double Drop If Vulnerability
MODERATECVE-2021-26954 is a MODERATE (CVSS 5.3) insert_slice_clone can double drop if vulnerability (CWE-415: Double Free) affecting Qwutils libraries in the crates.io ecosystem. The issue involves insert_slice_clone can double drop if clone panics.. Remediation is available by upgrading affected packages to version 0.3.1.
CVE-2021-26954 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2021-26954
To remediate this vulnerability, upgrade all affected Qwutils dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade qwutils to 0.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for qwutils
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-26954, inspect your project dependencies for Qwutils:
inspect dependencies for qwutils
Analyze the terminal output to locate any version of Qwutils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-415: Double Free, where the product calls free() twice on the same memory address. In Qwutils, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-26954 Affected Qwutils Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
qwutils
|
crates.io |
< 0.3.1
|
0.3.1
|
References
Frequently Asked Questions
What is CVE-2021-26954?
Which Qwutils versions are affected?
What version fixes CVE-2021-26954?
Is qwutils affected?
What is the CVSS score of CVE-2021-26954?
What CWE is associated with CVE-2021-26954?
How can I check crates.io dependencies for CVE-2021-26954?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-68p4-pjpf-xwcq",
"modified" : "2023-06-13T20:09:07Z",
"published" : "2022-05-24T17:41:47Z",
"aliases" : [ "CVE-2021-26954" ],
"summary" : "insert_slice_clone can double drop if Clone panics.",
"details" : "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.\n\nThis issue can result in an element being double-freed if the clone call panics.\n\nCommit `20cb73d` fixed this issue by adding a set_len(0) call before operating on the vector to avoid dropping the elements during a panic.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "qwutils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-26954"
}, {
"type" : "WEB",
"url" : "https://github.com/qwertz19281/rust_utils/issues/3"
}, {
"type" : "WEB",
"url" : "https://github.com/qwertz19281/rust_utils/commit/20cb73d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/qwertz19281/rust_utils"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2021-0018.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-415" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T00:14:33Z",
"nvd_published_at" : "2021-02-09T23:15:00Z"
}
}