GHSA-48m6-wm5p-rr6h
high
Insufficient covariance check makes self_cell unsound
- Severity
- high rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2023-0070
Description
All public versions prior to 1.02 used an insufficient check to ensure that users correctly marked the dependent type as either covariant or not_covariant. This allowed users to mark a dependent as covariant even though its type was not covariant but invariant, for certain invariant types involving trait object lifetimes. One example for such a dependent type is type Dependent<'a> = RefCell<Box<dyn fmt::Display + 'a>>. Such a type allowed unsound usage in purely safe user code that leads to undefined behavior. The patched versions now produce a compile time error if such a type is marked as covariant.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| self_cell (crates.io) | before 0.10.3, from 1.0.0 before 1.0.2, from 0.0.0-0 before 0.10.3 | GitHub Advisory Database, RustSec Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-48m6-wm5p-rr6h changed 2024-02-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0070 changed 2024-02-10 | CC0-1.0 |