GHSA-655h-hg88-5qmf: Rust XCB `xcb :Connection::connect_to_fd*` Functions Violate I/O Safety Vulnerability

LOW
CWE-672 CWE-666
Published
Advisory Summary

GHSA-655h-hg88-5qmf is a LOW :connection::connect_to_fd*` functions violate i/o safety vulnerability (CWE-672: Operation on a Resource after Expiration or Release) affecting Rust XCB `xcb libraries in the crates.io ecosystem. The issue involves :connection::connect_to_fd*` functions violate i/o safety. Remediation is available by upgrading affected packages to version 1.6.0.

GHSA-655h-hg88-5qmf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-655h-hg88-5qmf
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-672: Operation on a Resource after Expiration or Release
Affected Product Rust XCB `xcb
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-655h-hg88-5qmf

To remediate this vulnerability, upgrade all affected Rust XCB `xcb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

xcb fixed: 1.6.0
Upgrade xcb to 1.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for xcb

How to Check if You Are Affected

To determine whether your application is affected by GHSA-655h-hg88-5qmf, inspect your project dependencies for Rust XCB `xcb:

inspect dependencies for xcb

Analyze the terminal output to locate any version of Rust XCB `xcb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-672: Operation on a Resource after Expiration or Release, where the product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked. In Rust XCB `xcb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-655h-hg88-5qmf Affected Rust XCB `xcb Versions

1 component(s)
Fixed Versions:
1.6.0
Product / Package Ecosystem Affected Versions Fixed Version
xcb
crates.io
< 1.6.0
1.6.0

References

Frequently Asked Questions

What is GHSA-655h-hg88-5qmf?
GHSA-655h-hg88-5qmf is a security vulnerability in Rust XCB `xcb involving :Connection::connect_to_fd*` functions violate I/O safety under CWE-672: Operation on a Resource after Expiration or Release.
Which Rust XCB `xcb versions are affected?
Affected versions include releases prior to 1.6.0 across affected packages: xcb.
What version fixes GHSA-655h-hg88-5qmf?
Upgrading to 1.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xcb affected?
Yes, xcb is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
What CWE is associated with GHSA-655h-hg88-5qmf?
GHSA-655h-hg88-5qmf is classified under CWE-672: Operation on a Resource after Expiration or Release (The product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.).
How can I check crates.io dependencies for GHSA-655h-hg88-5qmf?
Run the dependency tree command: 'inspect dependencies for xcb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-655h-hg88-5qmf",
  "modified" : "2025-08-22T17:34:45Z",
  "published" : "2025-08-22T17:34:45Z",
  "aliases" : [ ],
  "summary" : "Rust XCB `xcb::Connection::connect_to_fd*` functions violate I/O safety",
  "details" : "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.\n\nStarting 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "xcb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rust-x-bindings/rust-xcb/issues/167"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-x-bindings/rust-xcb/issues/282"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-x-bindings/rust-xcb/pull/283"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rustsec/advisory-db/pull/2355"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rust-x-bindings/rust-xcb/commit/da830976870c1174e3b33eb0643177be3991c002"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rust-x-bindings/rust-xcb"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2025-0051.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-666", "CWE-672" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-22T17:34:45Z",
    "nvd_published_at" : null
  }
}