CVE-2020-36205
Description
An issue was discovered in the xcb crate through 2020-12-10 for Rust. base::Error does not have soundness. Because of the public ptr field, a use-after-free or double-free can occur.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The xcb crate's base::Error struct exposes a public ptr field, allowing safe Rust code to trigger use-after-free or double-free.
The xcb crate for Rust provides bindings to the X11 protocol. A soundness issue exists in the base::Error type, which contains a public ptr field [1][3]. Because the field is publicly accessible, safe Rust code can construct an Error instance with an arbitrary pointer, violating Rust's memory safety guarantees [4].
An attacker can exploit this by creating an Error object pointing to a stack or heap variable, then dropping the original variable while the Error still holds the pointer. This leads to a use-after-free condition. The RustSec advisory notes that the vulnerability can be triggered without any unsafe code, as the struct's fields are public [3]. A proof-of-concept demonstrates that after creating an Error with a pointer to a vector's buffer, subsequent operations on the vector can cause double-free or use-after-free [4].
The impact is primarily on availability, as the vulnerability can cause memory corruption leading to crashes or undefined behavior. The CVSS score is 5.5 (Medium) with availability impact rated High [3]. Confidentiality and integrity are not directly affected, but memory corruption could potentially be leveraged further.
The issue was fixed in version 1.0 of the xcb crate [3]. Users should upgrade to xcb >=1.0. The advisory recommends that the Error struct should have a hidden constructor or be marked unsafe to prevent misuse [4].
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.
| Package | Affected versions | Patched versions |
|---|---|---|
xcbcrates.io | < 1.0.0 | 1.0.0 |
Affected products
2- Rust/xcb cratedescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-c8hq-x4mm-p6q6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-36205ghsaADVISORY
- github.com/rtbo/rust-xcb/issues/93ghsaWEB
- github.com/rust-x-bindings/rust-xcb/issues/93ghsaWEB
- rustsec.org/advisories/RUSTSEC-2020-0097.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.