Advisory

GHSA-48m6-wm5p-rr6h

Also known as: RUSTSEC-2023-0070

Summary

Insufficient covariance check makes self_cell unsound

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2023-11-14 18:32 UTC
Modified
2024-02-10 16:26 UTC

Affected packages and fixes

self_cell

crates.io · All systems

Affected

  • introduced 0, fixed 0.10.3 (semver)

Fixed versions

0.10.3

Fix

  • Fixed version 0.10.3
    cargo update -p self_cell --precise 0.10.3

self_cell

crates.io · All systems

Affected

  • introduced 1.0.0, fixed 1.0.2 (semver)

Fixed versions

1.0.2

Fix

  • Fixed version 1.0.2
    cargo update -p self_cell --precise 1.0.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences