RUSTSEC-2021-0018

Source
https://rustsec.org/advisories/RUSTSEC-2021-0018
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0018.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2021-0018
Aliases
Published
2021-02-03T12:00:00Z
Modified
2023-11-08T04:05:23.024619Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
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.

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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / qwutils

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.3.1

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "qwutils::imp::vec::VecExt::insert_slice_clone"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}