CVE-2021-26955
Unchecked Return Value in xcb
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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.
- Record
CVE-2021-26955- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-252
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2021-26955- Updated
- 2026-11-02
EUVDEUVD-2021-1523 No score
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.
- Record
EUVD-2021-1523- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-3288-cwgw-ch86
9.8
Unchecked Return Value in xcb
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.
- Record
GHSA-3288-cwgw-ch86- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-252
- Updated
- 2026-11-02
OSV
9.8
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.
- Record
CVE-2021-26955- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVCVE-2021-26956
9.8
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because bytes from an X server can be interpreted as any data type returned by xcb::xproto::GetPropertyReply::value.
- Record
CVE-2021-26956- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 9 moreShow less
OSVCVE-2021-26957
9.8
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because there is an out-of-bounds read in xcb::xproto::change_property(), as demonstrated by a format=32 T=u8 situation where out-of-bounds bytes are sent to an X server.
- Record
CVE-2021-26957- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVCVE-2021-26958
8.8
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.
- Record
CVE-2021-26958- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-26955
9.8
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.
- Record
DEBIAN-CVE-2021-26955- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-2xpg-3hx4-fm9r
9.8
Out of bounds read in xcb
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because there is an out-of-bounds read in xcb::xproto::change_property(), as demonstrated by a format=32 T=u8 situation where out-of-bounds bytes are sent to an X server.
- Record
GHSA-2xpg-3hx4-fm9r- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-125
- Updated
- 2026-11-02
OSVGHSA-3288-cwgw-ch86
9.8
Unchecked Return Value in xcb
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.
- Record
GHSA-3288-cwgw-ch86- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-252
- Updated
- 2026-11-02
OSVGHSA-3cj3-jrrp-9rxf
8.8
Unchecked Return Value in xcb
An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.
- Record
GHSA-3cj3-jrrp-9rxf- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-252
- Updated
- 2026-11-02
OSVGHSA-mp6r-fgw2-rxfx
9.8
Arbitrary return types in xcb
The function xcb::xproto::GetPropertyReply::value() returns a slice of type T where T is an unconstrained type parameter. The raw bytes received from the X11 server are interpreted as the requested type. The users of the xcb crate are advised to only call this function with the intended types. These are u8, u16, and u32.
This issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/95
- Record
GHSA-mp6r-fgw2-rxfx- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-657
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-26955
9.8
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.
- Record
UBUNTU-CVE-2021-26955- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVRUSTSEC-2021-0019 No score
Multiple soundness issues
Calls std::str::from_utf8_unchecked() without any checks
The function xcb::xproto::GetAtomNameReply::name() calls
std::str::from_utf8_unchecked() on the raw bytes that were received from the
X11 server without any validity checks. The X11 server only prevents interior
null bytes, but otherwise allows any X11 client to create an atom for arbitrary
bytes.
This issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/96
xcb::xproto::GetPropertyReply::value() allows arbitrary return types
The function xcb::xproto::GetPropertyReply::value() returns a slice of type
T where T is an unconstrained type parameter. The raw bytes received from
the X11 server are interpreted as the requested type.
The users of the xcb crate are advised to only call this function with the
intended types. These are u8, u16, and u32.
This issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/95
Out of bounds read in xcb::xproto::change_property()
xcb::xproto::change_property has (among others) the arguments format: u8 and
data: &[T]. The intended use is one of the following cases:
format = 8andT = u8format = 16andT = u16format = 32andT = u32However, this constraint is not enforced. For example, it is possible to call the function withformat = 32andT = u8. In this case, a read beyond the end of thedataslice is performed and the bytes are sent to the X11 server.
The users of the xcb crate are advised to only call this function with one of
the intended argument combinations.
This issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/94
'Safe' wrapper around std::mem::transmute()
The function xcb::base::cast_event() takes a reference to a
xcb::base::GenericEvent and returns a reference to an arbitrary type, as
requested by the caller (or found via type interference). The function is
implemented as a direct call to std::mem::transmute(). Since the return type
is not constrained, this allows transmution to an incorrect type or a type that
is larger than the X11 event that was passed in.
X11 events are mostly always 32 bytes large and this function works as intended.
Users are advised to only cast to the event structs provided by the xcb crate
(and hope for the best).
This issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/78
- Record
RUSTSEC-2021-0019- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
xcbcrates.io |
before 1.0.0 | 1.0.0 |
rust-xcbDebian:12 |
before 1.1.1-1 | 1.1.1-1 |
rust-xcbDebian:13 |
before 1.1.1-1 | 1.1.1-1 |
rust-xcbDebian:14 |
before 1.1.1-1 | 1.1.1-1 |
xcbcrates.io From an advisory covering 4 CVEs |
before 1.0.0 | 1.0.0 |
xcbcrates.io From an advisory covering 4 CVEs |
0.0.0-0 up to 1.0.0 | 1.0.0 |
rust-xcbUbuntu:22.04:LTS |
All versions, plus listed versions 0.9.0-2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-26955 is a critical vulnerability (CVSS 9.8) in Xcb Project Xcb, published February 4, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.75%, the 77th percentile. Fixed in xcb 1.0.0.
References
rustsec.org/advisories/RUSTSEC-2021-0019.html
nvd.nist.gov/vuln/detail/CVE-2021-26955
github.com/RustSec/advisory-db/issues/653
github.com/advisories/GHSA-3288-cwgw-ch86
security-tracker.debian.org/tracker/CVE-2021-26955
nvd.nist.gov/vuln/detail/CVE-2021-26957
Show 10 moreShow less
github.com/rtbo/rust-xcb
nvd.nist.gov/vuln/detail/CVE-2021-26958
nvd.nist.gov/vuln/detail/CVE-2021-26956
github.com/rust-x-bindings/rust-xcb/issues/95
crates.io/crates/xcb
github.com/rust-x-bindings/rust-xcb/issues/78
github.com/rust-x-bindings/rust-xcb/issues/94
github.com/rust-x-bindings/rust-xcb/issues/96
ubuntu.com/security/CVE-2021-26955
cve.org/CVERecord?id=CVE-2021-26955