# GHSA-655h-hg88-5qmf: Rust XCB `xcb::Connection::connect_to_fd*` functions violate I/O safety

- Severity: Low (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-08-05T12:00:00.000Z
- Modified: 2025-10-28T06:29:23.247Z
- Also known as: RUSTSEC-2025-0051
- Weaknesses: CWE-666, CWE-672

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- xcb (crates.io): before 1.6.0; from 0.0.0-0 before 1.6.0

## References

- <https://github.com/rust-x-bindings/rust-xcb/issues/167> (report, web)
- <https://github.com/rust-x-bindings/rust-xcb/issues/282> (report, web)
- <https://github.com/rust-x-bindings/rust-xcb/pull/283> (web)
- <https://github.com/rustsec/advisory-db/pull/2355> (web)
- <https://github.com/rust-x-bindings/rust-xcb/commit/da830976870c1174e3b33eb0643177be3991c002> (web)
- <https://github.com/rust-x-bindings/rust-xcb> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0051.html> (advisory, web)
- <https://crates.io/crates/xcb> (package)

## Sources

- GitHub Advisory Database: [GHSA-655h-hg88-5qmf](https://github.com/advisories/GHSA-655h-hg88-5qmf), CC-BY-4.0, modified 2025-10-28
- RustSec Advisory Database: [RUSTSEC-2025-0051](https://rustsec.org/advisories/RUSTSEC-2025-0051.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-655h-hg88-5qmf · Whole record: https://cve.day/GHSA-655h-hg88-5qmf.json · Rebuilt by cve.day 2026-11-25T22:56:43.262Z
