Vulnerability MediumRUSTSEC-2020-0151 · generator
RUSTSEC-2020-0151: Generators can cause data races if non-Send types are used in their generator functions
Short answerA security vulnerability in the generator crate: Generators can cause data races if non-Send types are used in their generator functions. Medium severity (CVSS 5.9). Fixed in 0.7.0: update to a fixed version.
| Crate | generator |
|---|---|
| Type | Vulnerability (memory-corruption) |
| Affected versions | Before 0.7.0. |
| Fixed in | 0.7.0 |
| Severity | Medium, CVSS 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Published | 2020-11-16 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2020-36471, GHSA-w3g5-2848-2v8r |
What to do
- See which version you have:
cargo tree -i generator(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p generator. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplegenerator = "0.7.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The Generator type is an iterable which uses a generator function that yields values. In affected versions of the crate, the provided function yielding values had no Send bounds despite the Generator itself implementing Send.
The generator function lacking a Send bound means that types that are dangerous to send across threads such as Rc could be sent as part of a generator, potentially leading to data races.
This flaw was fixed in commit f7d120a3b by enforcing that the generator function be bound by Send.
References
- Package: crates.io/crates/generator
- Advisory: rustsec.org/advisories/RUSTSEC-2020-0151.html
- Report: github.com/Xudong-Huang/generator-rs/issues/27
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for generator
Up next
Same crategenerator: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?