CVE-2021-26955
Description
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because xcb::xproto::GetAtomNameReply::name() calls std::str::from_utf8_unchecked() on unvalidated bytes from an X server.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The xcb Rust crate (≤2021-02-04) has a soundness bug in GetAtomNameReply::name() using from_utf8_unchecked on unvalidated X server bytes, risking undefined behavior.
Vulnerability
CVE-2021-26955 is a soundness violation in the xcb crate for Rust (versions through 2021-02-04). The issue lies in xcb::xproto::GetAtomNameReply::name(), which calls std::str::from_utf8_unchecked() on bytes received from an X server without validating that they form valid UTF-8 [1][2]. This breaks Rust's safety guarantees because the bytes could come from a malicious or untrusted X server.
Exploitation
An attacker who can control an X server that a client connects to can send arbitrary bytes in the atom name reply. Since the crate does not validate UTF-8, invoking name() on such a reply leads to undefined behavior in safe Rust code [2]. No special privileges beyond network access to the client are required if the client connects to the attacker's X server.
Impact
The undefined behavior can manifest as memory corruption or memory exposure, as categorized in the RustSec advisory [2]. This could potentially be leveraged for further compromise of the client application or data leakage. The crate is also flagged for multiple soundness issues [4].
Mitigation
The xcb crate is unmaintained, as stated in its README [3]. Users are advised to avoid using it entirely and migrate to alternatives such as x11rb or direct Xlib bindings. No patch is available for the affected versions [2][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/xcbdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-3288-cwgw-ch86ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-26955ghsaADVISORY
- github.com/RustSec/advisory-db/issues/653ghsaWEB
- rustsec.org/advisories/RUSTSEC-2021-0019.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.