GHSA-jh2m-fhpj-3vr7

GHSA-jh2m-fhpj-3vr7 · RUSTSEC-2026-0486 · published 27 Oct 2026 · updated 11 Nov 2026

xattr functions mark unwritten bytes as initialized when given a zero-length buffer

5.0Medium

No exploitation in the wild has been reported. Fixed in rustix 1.1.6.

The extended-attribute functions in `rustix::fs` (`getxattr`, `lgetxattr`, `fgetxattr`, `listxattr`, `llistxattr` and `flistxattr`) write into a `Buffer` and then mark as many bytes initialized as the system call reported. When the buffer has zero length, the operating system treats the call as a size query: it writes nothing and returns the size of the attribute value or of the name list. rustix still marked that many bytes as initialized. Passing a `Vec` whose length equals its capacity through `spare_capacity` gives such a zero-length buffer, and rustix then set the vector's length past its capacity over memory that was never written. This is undefined behavior reachable from safe code. With an empty `&mut [MaybeUninit<u8>]` the call panics instead. From 1.1.6 these functions return an empty result for a zero-length buffer, and new `getxattr_query`, `lgetxattr_query`, `fgetxattr_query`, `listxattr_query`, `llistxattr_query` and `flistxattr_query` functions return the size. The 0.38 series did not have the `Buffer` API and is not affected.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
cargo: rustix>=1.0.0 <1.1.61.1.6

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

GHSA-jh2m-fhpj-3vr7 severity on Zeptric[![GHSA-jh2m-fhpj-3vr7](https://zeptric.io/badge/cve/GHSA-jh2m-fhpj-3vr7.svg)](https://zeptric.io/cve/GHSA-jh2m-fhpj-3vr7)