GitHub Advisoryadvisory · crates.io
GHSA-wcvp-r8j8-47pc Double free in toodee
CRITICAL
Official page ↗
- Aliases
- CVE-2021-28028
- Ecosystem
- crates.io
- Packages
- toodee
- Severity
- Critical
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-415
- Reviewed
- 2021-08-30
Affected packages
• crates.io toodee: < 0.3.0 → fixed in 0.3.0
Description
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.
Related
Alias · CVE (1)
- CVE-2021-28028 An issue was discovered in the toodee crate before 0.3.0 for Rust. vulnerability
Weakness · CWE (1)
- CWE-415 Double Free weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-28028 advisory
- https://github.com/antonmarsden/toodee/issues/13 web
- https://github.com/antonmarsden/toodee/commit/ced70c172486fb4827c172cd8238053df3d1dcdb web
- https://github.com/antonmarsden/toodee package
- https://rustsec.org/advisories/RUSTSEC-2021-0028.html web