Unratedcrates.ioPublished
cell-project used incorrect variance when projecting through &Cell
GHSA-p75v-367r-2v23
- Affected
- crates.io cell-project < 0.1.4
- Fixed in
- 0.1.4· Vendor fix available
- Issue
- The issue lies in the implementation of the cellproject macro which used field as const instead of field as mut . The problem being that const T is covariant in T while mut T is invariant in T. Keep in mind that &Cell<T is invariant in T, so casting to const T relaxed the variance, and lead to unsoundness, as shown in the example below. MIRI error Affected Versions All versions of the cell-project crate before 0.1.4 are affected. Mitigation This was fixed in [Issues/4], and released as version 0.1.4. So just updating to the latest version will include the fix (which may result in a compile error on unsound usage). Acknowledgements This was discovered and fixed by @SoniEx2 in cell-project: [Issues/3] and [Issues/4] [issues/3]: https://github.com/RustyYato/cell-project/issues/3 [issues/4]: https://github.com/RustyYato/cell-project/issues/4
Recommended action: Upgrade to 0.1.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.