# GHSA-48m6-wm5p-rr6h: Insufficient covariance check makes self_cell unsound

- Severity: High (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2023-11-10T12:00:00.000Z
- Modified: 2024-02-10T16:26:48.155Z
- 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`.

(As written by GitHub Advisory Database.)

## Affected

- 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

## References

- <https://github.com/Voultapher/self_cell/issues/49> (report, web)
- <https://github.com/Voultapher/self_cell> (package)
- <https://rustsec.org/advisories/RUSTSEC-2023-0070.html> (advisory, web)
- <https://crates.io/crates/self_cell> (package)

## Sources

- GitHub Advisory Database: [GHSA-48m6-wm5p-rr6h](https://github.com/advisories/GHSA-48m6-wm5p-rr6h), CC-BY-4.0, modified 2024-02-10
- RustSec Advisory Database: [RUSTSEC-2023-0070](https://rustsec.org/advisories/RUSTSEC-2023-0070.html), CC0-1.0, modified 2024-02-10

---

Page: https://cve.day/GHSA-48m6-wm5p-rr6h · Whole record: https://cve.day/GHSA-48m6-wm5p-rr6h.json · Rebuilt by cve.day 2026-11-25T22:56:43.161Z
