GHSA-48m6-wm5p-rr6h Insufficient covariance check makes self_cell unsound
- Published
- Updated
- Exploit status
- No public exploit known
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io self_cell(crates.io) | < 0.10.3; >= 0.0.0-0, < 0.10.3; >= 1.0.0, < 1.0.2 | 0.10.3, 1.0.2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io self_cell(crates.io) | < 0.10.3 | 0.10.3 |
| crates.io self_cell(crates.io) | >= 1.0.0, < 1.0.2 | 1.0.2 |
| crates.io self_cell(crates.io) | >= 0.0.0-0, < 0.10.3 | 0.10.3 |
References
- github.com issue-tracking
- rustsec.org vendor-advisory
- github.com
- github.com product
- crates.io product