GHSA-48m6-wm5p-rr6h Insufficient covariance check makes self_cell unsound
Insufficient covariance checks in the self_cell library allow safe code to trigger undefined behavior, potentially leading to memory corruption and code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-48m6-wm5p-rr6h?
GHSA-48m6-wm5p-rr6h is a memory corruption vulnerability in self_cell, published on 10 Nov 2023.
Official description
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.Which versions are affected by GHSA-48m6-wm5p-rr6h?
5 open source packages ship an affected version, including self_cell.
| Package | Affected | Fixed in |
|---|---|---|
self_cell crates.io | All versions | 0.10.3 |
self_cell crates.io | All versions | 0.10.3 |
self_cell crates.io | From 0.0.0-0 | 0.10.3, 1.0.2 |
self_cell crates.io | From 1.0.0 | 1.0.2 |
self_cell crates.io | From 1.0.0 | 1.0.2 |
How do I fix GHSA-48m6-wm5p-rr6h?
Upgrade self_cell to a fixed version for your release line: 0.10.3 or 1.0.2.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is GHSA-48m6-wm5p-rr6h being exploited?
There is no known exploitation of GHSA-48m6-wm5p-rr6h in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0070.