# GHSA-9c9f-7x9p-4wqp: A malicious coder can get unsound access to TCell or TLCell memory

- Severity: High (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-01-24T12:00:00.000Z
- Modified: 2023-11-08T04:17:51.156Z
- Also known as: RUSTSEC-2022-0007

## Description

This is impossible to do by accident, but by carefully constructing
marker types to be covariant, a malicious coder can cheat the
singleton check in `TCellOwner` and `TLCellOwner`, giving unsound
access to cell memory.  This could take the form of getting two
mutable references to the same memory, or a mutable reference and an
immutable reference.

The fix is for the crate to internally force the marker type to be
invariant.  This blocks the conversion between covariant types which
Rust normally allows.

(As written by GitHub Advisory Database.)

## Affected

- qcell (crates.io): before 0.4.3; from 0.0.0-0 before 0.4.3

## References

- <https://github.com/uazu/qcell/issues/20> (report, web)
- <https://github.com/uazu/qcell> (package)
- <https://rustsec.org/advisories/RUSTSEC-2022-0007.html> (advisory, web)
- <https://crates.io/crates/qcell> (package)

## Sources

- GitHub Advisory Database: [GHSA-9c9f-7x9p-4wqp](https://github.com/advisories/GHSA-9c9f-7x9p-4wqp), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2022-0007](https://rustsec.org/advisories/RUSTSEC-2022-0007.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-9c9f-7x9p-4wqp · Whole record: https://cve.day/GHSA-9c9f-7x9p-4wqp.json · Rebuilt by cve.day 2026-11-25T22:56:43.090Z
