GitHub Advisoryadvisory · crates.io

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

LOW Published 2025-08-22 Modified 2025-08-22 Official page ↗
Ecosystem
crates.io
Packages
xcb
Severity
Low
CVSS vector
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
Weaknesses
CWE-666, CWE-672
Reviewed
2025-08-22

Affected packages

• crates.io xcb: < 1.6.0 → fixed in 1.6.0

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.

Related

Weakness · CWE (2)

  • CWE-666 Operation on Resource in Wrong Phase of Lifetime weakness
  • CWE-672 Operation on a Resource after Expiration or Release weakness

References