VYPR
Critical severityNVD Advisory· Published Feb 9, 2021· Updated Aug 3, 2024

CVE-2021-26955

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.

PackageAffected versionsPatched versions
xcbcrates.io
< 1.0.01.0.0

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.