GHSA-3qm2-rfqw-fmrw

Suggest an improvement
Source
https://github.com/advisories/GHSA-3qm2-rfqw-fmrw
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-3qm2-rfqw-fmrw/GHSA-3qm2-rfqw-fmrw.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-3qm2-rfqw-fmrw
Aliases
Published
2022-05-24T17:43:48Z
Modified
2023-11-08T04:05:27.727053Z
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
move_elements can double-free objects on panic
Details

Affected versions of scratchpad used ptr::read to read elements while calling a user provided function f on them. Since the pointer read duplicates ownership, a panic inside the user provided f function could cause a double free when unwinding.

The flaw was fixed in commit 891561bea by removing the unsafe block and using a plain iterator.

Database specific
{
    "nvd_published_at": "2021-03-05T09:15:00Z",
    "cwe_ids": [
        "CWE-415"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2022-06-17T00:23:59Z"
}
References

Affected packages

crates.io / scratchpad

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.3.1

Ecosystem specific

{
    "affected_functions": [
        "scratchpad::SliceMoveSource::move_elements"
    ]
}