GHSA-wcvp-r8j8-47pc

Suggest an improvement
Source
https://github.com/advisories/GHSA-wcvp-r8j8-47pc
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/09/GHSA-wcvp-r8j8-47pc/GHSA-wcvp-r8j8-47pc.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wcvp-r8j8-47pc
Aliases
Published
2021-09-01T18:30:35Z
Modified
2023-11-08T04:05:27.607591Z
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
Double free in toodee
Details

When inserting rows from an iterator at a particular index, toodee would shift items over, duplicating their ownership. The space reserved for the new elements was based on the len() returned by the ExactSizeIterator.

This could result in elements in the array being freed twice if the iterator panics. Uninitialized or previously freed elements could also be exposed if the len() didn't match the number of elements.

These issues were fixed in commit ced70c17 by temporarily setting the length of the array smaller while processing it and adding assertions on the number of elements returned by the iterator.

Database specific
{
    "nvd_published_at": "2021-03-05T09:15:00Z",
    "cwe_ids": [
        "CWE-415"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2021-08-30T21:56:42Z"
}
References

Affected packages

crates.io / toodee

Package

Affected ranges

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

Ecosystem specific

{
    "affected_functions": [
        "toodee::TooDee::insert_row"
    ]
}