VYPR
Moderate severityNVD Advisory· Published Aug 8, 2021· Updated Aug 4, 2024

CVE-2020-36468

CVE-2020-36468

Description

An issue was discovered in the cgc crate through 2020-12-10 for Rust. Ptr::write performs non-atomic write operations on an underlying pointer.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Non-atomic write in Rust `cgc` crate's `Ptr::write` can cause data races, leading to undefined behavior in concurrent environments.

Vulnerability

The cgc crate (through version 2020-12-10) contains a soundness issue in the Ptr type's write method. The Ptr::set function calls self.0.write(val), which performs a non-atomic write to the underlying raw pointer [2][3]. This violates Rust's aliasing and concurrency guarantees, particularly when Ptr implements Send and Sync unconditionally for any T, allowing types like Rc and Cell to be shared across threads unsafely [3].

Exploitation

An attacker with no privileges can exploit this vulnerability in a multithreaded context. If a Ptr is sent to another thread (allowed due to unsound Send/Sync implementations), concurrent calls to Ptr::set on the same memory location can result in data races [2][3]. The attack requires no user interaction; it only needs the program to use Ptr across threads without proper synchronization.

Impact

Successful exploitation leads to memory corruption and undefined behavior (e.g., read/write conflicts, unexpected crashes) [2]. This can potentially escalate to arbitrary memory access or denial-of-service, depending on the program's logic.

Mitigation

As of the publication date, no patched version of cgc has been released. The RustSec advisory RUSTSEC-2020-0148 lists the vulnerability as unmitigated [2]. Users should avoid using Ptr in multi-threaded code or apply manual fixes: restrict Send/Sync to types that are Send/Sync themselves, and replace write with atomic operations [3].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
cgccrates.io
<= 0.4.0

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.