Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. qwutils
  4. ›
  5. CVE-2021-26954

CVE-2021-26954: insert_slice_clone can double drop if Clone panics.

May 24, 2022 (updated June 13, 2023)

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.

References

  • github.com/advisories/GHSA-68p4-pjpf-xwcq
  • github.com/qwertz19281/rust_utils
  • github.com/qwertz19281/rust_utils/commit/20cb73d
  • github.com/qwertz19281/rust_utils/issues/3
  • nvd.nist.gov/vuln/detail/CVE-2021-26954
  • rustsec.org/advisories/RUSTSEC-2021-0018.html

Code Behaviors & Features

Detect and mitigate CVE-2021-26954 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.3.1

Fixed versions

  • 0.3.1

Solution

Upgrade to version 0.3.1 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-415: Double Free

Source file

cargo/qwutils/CVE-2021-26954.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:37 +0000.