Rust advisories / self_cell
Vulnerability HighRUSTSEC-2023-0070 · self_cell
RUSTSEC-2023-0070: Insufficient covariance check makes self_cell unsound
Short answerA security vulnerability in the self_cell crate: Insufficient covariance check makes self_cell unsound. GitHub rates it High. Fixed in 0.10.3, 1.0.2: update to a fixed version.
| Crate | self_cell |
|---|---|
| Type | Vulnerability |
| Affected versions | Before 0.10.3; from 1.0.0 before 1.0.2. |
| Fixed in | 0.10.3, 1.0.2 |
| Severity | High (GitHub rating) |
| Published | 2023-11-10 |
| Last changed | 2024-02-10 |
| Also known as | GHSA-48m6-wm5p-rr6h |
What to do
- See which version you have:
cargo tree -i self_cell(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p self_cell. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleself_cell = "1.0.2") 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
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.
References
- Package: crates.io/crates/self_cell
- Advisory: rustsec.org/advisories/RUSTSEC-2023-0070.html
- Report: github.com/Voultapher/self_cell/issues/49
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?