RUSTSEC-2021-0049

See a problem?
Source
https://rustsec.org/advisories/RUSTSEC-2021-0049
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0049.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2021-0049
Aliases
Published
2021-02-18T12:00:00Z
Modified
2023-11-08T04:05:44.127003Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
`through` and `through_and` causes a double free if the map function panics
Details

through and through_and take a mutable reference as well as a mapping function to change the provided reference. They do this by calling ptr::read on the reference which duplicates ownership and then calling the mapping function.

If the mapping function panics, both the original object and the one duplicated by ptr::read get dropped, causing a double free.

References

Affected packages

crates.io / through

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

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