Email me

Rust advisories / xcb

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.

Cratexcb
TypeUnsound
Affected versionsBefore 1.6.0.
Fixed in1.6.0
SeverityLow (GitHub rating)
Published2025-08-05
Last changed2025-10-28
Also known asGHSA-655h-hg88-5qmf
Affected functionsxcb::Connection::connect_to_fd, xcb::Connection::connect_to_fd_with_extensions

What to do

  1. See which version you have: cargo tree -i xcb (it also shows which of your dependencies pulls it in).
  2. 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 example xcb = "1.6.0") or update the dependency that pulls it in.
  3. 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

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

Full security history of 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?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ