{"id":"CVE-2021-26958","aliases":["DEBIAN-CVE-2021-26958","EUVD-2021-1543","GHSA-2xpg-3hx4-fm9r","GHSA-3288-cwgw-ch86","GHSA-3cj3-jrrp-9rxf","GHSA-mp6r-fgw2-rxfx","RUSTSEC-2021-0019","UBUNTU-CVE-2021-26958"],"status":"published","title":"Unchecked Return Value in xcb","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-12","score":0.01619,"percentile":0.7641,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-125","CWE-252","CWE-657"],"published":"2021-02-04T12:00:00Z","modified":"2026-10-23T18:03:57Z","fixes":[{"ecosystem":"crates.io","package":"xcb","fixed_in":["1.0.0"],"sources":["ghsa"]},{"ecosystem":"Debian:12","package":"rust-xcb","fixed_in":["1.1.1-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"rust-xcb","fixed_in":["1.1.1-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"rust-xcb","fixed_in":["1.1.1-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"rust-xcb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.1-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"rust-xcb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.1-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"rust-xcb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.1-1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}],"bundled":4},{"source":"osv","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}],"bundled":4},{"source":"osv","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}],"bundled":4},{"source":"osv","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}],"bundled":4},{"source":"osv","ecosystem":"crates.io","package":"xcb","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"1.0.0"}]}],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"rust-xcb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.9.0-2"]}],"products":[{"vendor":"xcb_project","product":"xcb"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0019.html","tags":["x_refsource_MISC","x_transferred","Exploit","Vendor Advisory","evidence","web","advisory","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26958","tags":["advisory"]},{"url":"https://github.com/RustSec/advisory-db/issues/653","tags":["web","report"]},{"url":"https://github.com/advisories/GHSA-3cj3-jrrp-9rxf"},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-26958","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26957","tags":["advisory"]},{"url":"https://github.com/rtbo/rust-xcb","tags":["package"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26955","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26956","tags":["advisory"]},{"url":"https://github.com/rust-x-bindings/rust-xcb/issues/95","tags":["web","report"]},{"url":"https://crates.io/crates/xcb","tags":["package"]},{"url":"https://github.com/rust-x-bindings/rust-xcb/issues/78","tags":["report"]},{"url":"https://github.com/rust-x-bindings/rust-xcb/issues/94","tags":["report"]},{"url":"https://github.com/rust-x-bindings/rust-xcb/issues/96","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2021-26958","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-26958","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2021-26958","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T22:07:10Z","modified":"2024-08-03T20:33:41.566Z","updated_at":"2026-11-02T14:32:57.033395Z"}],"euvd":[{"id":"EUVD-2021-1543","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T22:07:10Z","modified":"2024-08-03T20:33:41Z","updated_at":"2026-11-03T03:24:50.84326Z"}],"ghsa":[{"id":"GHSA-3cj3-jrrp-9rxf","title":"Unchecked Return Value in xcb","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-08-25T20:53:18Z","modified":"2023-06-13T22:30:03Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-252"],"updated_at":"2026-11-02T14:36:54.225318Z"}],"nvd":[{"id":"CVE-2021-26958","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T23:15:14.383Z","modified":"2026-06-17T03:44:04.633Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.5,"vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-252"],"updated_at":"2026-11-02T14:06:50.031227Z"}],"osv":[{"id":"CVE-2021-26955","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because xcb::xproto::GetAtomNameReply::name() calls std::str::from_utf8_unchecked() on unvalidated bytes from an X server.","status":"published","published":"2021-02-09T23:15:13.913Z","modified":"2026-03-14T10:52:40.816565Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"CVE-2021-26956","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because bytes from an X server can be interpreted as any data type returned by xcb::xproto::GetPropertyReply::value.","status":"published","published":"2021-02-09T23:15:13.96Z","modified":"2026-03-14T10:52:38.091815Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"CVE-2021-26957","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because there is an out-of-bounds read in xcb::xproto::change_property(), as demonstrated by a format=32 T=u8 situation where out-of-bounds bytes are sent to an X server.","status":"published","published":"2021-02-09T23:15:14.023Z","modified":"2026-03-14T10:52:39.041025Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"CVE-2021-26958","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T23:15:14.383Z","modified":"2026-03-14T10:49:39.392103Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"DEBIAN-CVE-2021-26958","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T23:15:14.383Z","modified":"2026-10-23T18:03:57.147443885Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:34.637046Z"},{"id":"GHSA-2xpg-3hx4-fm9r","title":"Out of bounds read in xcb","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because there is an out-of-bounds read in xcb::xproto::change_property(), as demonstrated by a format=32 T=u8 situation where out-of-bounds bytes are sent to an X server.","status":"published","published":"2021-08-25T20:53:20Z","modified":"2024-03-15T00:05:17.174146Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-125"],"updated_at":"2026-11-02T15:46:35.050232Z"},{"id":"GHSA-3288-cwgw-ch86","title":"Unchecked Return Value in xcb","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because xcb::xproto::GetAtomNameReply::name() calls std::str::from_utf8_unchecked() on unvalidated bytes from an X server.","status":"published","published":"2021-08-25T20:53:22Z","modified":"2024-03-15T00:05:17.174146Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-252"],"updated_at":"2026-11-02T15:46:35.050232Z"},{"id":"GHSA-3cj3-jrrp-9rxf","title":"Unchecked Return Value in xcb","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-08-25T20:53:18Z","modified":"2024-03-15T00:05:17.174146Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-252"],"updated_at":"2026-11-02T15:46:35.406455Z"},{"id":"GHSA-mp6r-fgw2-rxfx","title":"Arbitrary return types in xcb","description":"The function xcb::xproto::GetPropertyReply::value() returns a slice of type T where T is an unconstrained type parameter. The raw bytes received from the X11 server are interpreted as the requested type. The users of the xcb crate are advised to only call this function with the intended types. These are u8, u16, and u32.\n\nThis issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/95","status":"published","published":"2021-08-25T20:53:27Z","modified":"2024-03-15T00:05:17.174146Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-657"],"updated_at":"2026-11-02T15:46:52.170928Z"},{"id":"UBUNTU-CVE-2021-26958","description":"An issue was discovered in the xcb crate through 2021-02-04 for Rust. It has a soundness violation because transmutation to the wrong type can happen after xcb::base::cast_event uses std::mem::transmute to return a reference to an arbitrary type.","status":"published","published":"2021-02-09T23:15:00Z","modified":"2025-09-08T16:47:02Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:54:26.779273Z"},{"id":"RUSTSEC-2021-0019","title":"Multiple soundness issues","description":"## Calls `std::str::from_utf8_unchecked()` without any checks\n\nThe function `xcb::xproto::GetAtomNameReply::name()` calls\n`std::str::from_utf8_unchecked()` on the raw bytes that were received from the\nX11 server without any validity checks. The X11 server only prevents interior\nnull bytes, but otherwise allows any X11 client to create an atom for arbitrary\nbytes.\n\nThis issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/96\n\n## `xcb::xproto::GetPropertyReply::value()` allows arbitrary return types\n\nThe function `xcb::xproto::GetPropertyReply::value()` returns a slice of type\n`T` where `T` is an unconstrained type parameter. The raw bytes received from\nthe X11 server are interpreted as the requested type.\n\nThe users of the `xcb` crate are advised to only call this function with the\nintended types. These are `u8`, `u16`, and `u32`.\n\nThis issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/95\n\n## Out of bounds read in `xcb::xproto::change_property()`\n\n`xcb::xproto::change_property` has (among others) the arguments `format: u8` and\n`data: \u0026[T]`. The intended use is one of the following cases:\n- `format = 8` and `T = u8`\n- `format = 16` and `T = u16`\n- `format = 32` and `T = u32`\nHowever, this constraint is not enforced. For example, it is possible to call\nthe function with `format = 32` and `T = u8`. In this case, a read beyond the\nend of the `data` slice is performed and the bytes are sent to the X11 server.\n\nThe users of the `xcb` crate are advised to only call this function with one of\nthe intended argument combinations.\n\nThis issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/94\n\n## 'Safe' wrapper around `std::mem::transmute()`\n\nThe function `xcb::base::cast_event()` takes a reference to a\n`xcb::base::GenericEvent` and returns a reference to an arbitrary type, as\nrequested by the caller (or found via type interference). The function is\nimplemented as a direct call to `std::mem::transmute()`. Since the return type\nis not constrained, this allows transmution to an incorrect type or a type that\nis larger than the X11 event that was passed in.\n\nX11 events are mostly always 32 bytes large and this function works as intended.\n\nUsers are advised to only cast to the event structs provided by the `xcb` crate\n(and hope for the best).\n\nThis issue is tracked here: https://github.com/rust-x-bindings/rust-xcb/issues/78","status":"published","published":"2021-02-04T12:00:00Z","modified":"2024-03-15T00:05:17.174146Z","updated_at":"2026-11-02T15:53:39.492624Z"}]}}
