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

Not scored Published

A malicious coder can exploit covariance to bypass singleton checks, causing memory corruption and potential code execution in Rust applications using this library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Not stated
Victim action needed
Not needed
Fix
Available

What is GHSA-9c9f-7x9p-4wqp?

GHSA-9c9f-7x9p-4wqp is a memory corruption vulnerability in qcell, published on 24 Jan 2022.

Official 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.

Which versions are affected by GHSA-9c9f-7x9p-4wqp?

3 open source packages ship an affected version, including qcell.

PackageAffectedFixed in
qcell crates.ioAll versions0.4.3
qcell crates.ioAll versions0.4.3
qcell crates.ioFrom 0.0.0-00.4.3

How do I fix GHSA-9c9f-7x9p-4wqp?

Upgrade qcell to 0.4.3 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is GHSA-9c9f-7x9p-4wqp being exploited?

There is no known exploitation of GHSA-9c9f-7x9p-4wqp in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2022-0007.

Is GHSA-9c9f-7x9p-4wqp in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free