GHSA-48m6-wm5p-rr6h
JSON

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 packageVersionsReported 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.3GitHub Advisory Database, RustSec Advisory Database

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-48m6-wm5p-rr6h changed 2024-02-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2023-0070 changed 2024-02-10CC0-1.0