Unsound LowRUSTSEC-2025-0051 · xcb
RUSTSEC-2025-0051: `xcb::Connection::connect_to_fd*` functions violate I/O safety
Short answerxcb has an API that can cause undefined behaviour from safe code: `xcb::Connection::connect_to_fd*` functions violate I/O safety. Fixed in 1.6.0.
| Crate | xcb |
|---|---|
| Type | Unsound |
| Affected versions | Before 1.6.0. |
| Fixed in | 1.6.0 |
| Severity | Low (GitHub rating) |
| Published | 2025-08-05 |
| Last changed | 2025-10-28 |
| Also known as | GHSA-655h-hg88-5qmf |
| Affected functions | xcb::Connection::connect_to_fd, xcb::Connection::connect_to_fd_with_extensions |
What to do
- See which version you have:
cargo tree -i xcb(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p xcb. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplexcb = "1.6.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The API of xcb::Connection has constructors which allow an arbitrary RawFd to be used as a socket connection. On either failure of these constructors or on the drop of Connection, it closes the associated file descriptor. Thus, a program which uses an OwnedFd (such as a UnixStream) as the file descriptor can close the file descriptor and continue to attempt using it or close an already-closed file descriptor, violating I/O safety.
Starting in version 1.6.0, xcb provides Connection::connect_with_fd and Connection::connect_with_fd_and_extensions as safe alternatives and deprecates the problematic functions.
References
- Package: crates.io/crates/xcb
- Advisory: rustsec.org/advisories/RUSTSEC-2025-0051.html
- Report: github.com/rust-x-bindings/rust-xcb/issues/282
- Report: github.com/rust-x-bindings/rust-xcb/issues/167
- Web: github.com/rust-x-bindings/rust-xcb/pull/283
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for xcb
Up next
Same cratexcb: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?