# rustix xattr functions memory safety violation with zero-length buffer

Source: https://junglewise.ai/threats/rustsec-2026-0486-xattr-functions-mark-unwritten-bytes-as-initialized-5b0a3286  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-27. Updated: 2026-11-13  
License: CC BY 4.0 with a link back

Severity: info · Published 2026-10-27

The rustix library, a Rust abstraction for Unix system calls, contains a memory safety flaw in its extended attribute (xattr) functions. When querying the size of an attribute with a zero-length buffer, the library incorrectly marks uninitialized memory as initialized, potentially allowing data corruption or exposure. Applications using rustix versions 1.0.0 through 1.1.5 to access file metadata are vulnerable.

Vendors: [Bytecodealliance](https://junglewise.ai/threats/vendors/bytecodealliance), [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 27 October 2026.

**Which products and versions are affected?** Bytecodealliance Rustix >=1.0.0, <1.1.6; rustix (crates.io) SEMVER:introduced=1.0.0,fixed=1.1.6.

**Is there a fix for This vulnerability?** Yes. rustix (crates.io): upgrade to 1.1.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked with local access, in a software library.

**Am I affected?** Check whether you run Bytecodealliance Rustix or rustix (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- rustix (crates.io): upgrade to 1.1.6 or later

  ```sh
  cargo update -p rustix
  ```


## Technical details

The vulnerability exists in rustix::fs xattr functions (getxattr, lgetxattr, fgetxattr, listxattr, llistxattr, flistxattr) which write into a buffer and mark initialized bytes based on the system call's return value. When a zero-length buffer is passed (via Vec::spare_capacity when length equals capacity), the OS performs a size query returning only the size without writing data, but rustix incorrectly marks that many bytes as initialized, leading to undefined behavior when the vector length is set past its capacity. This is reachable from safe Rust code, violating memory safety guarantees.

## Affected products

- BytecodeAlliance rustix >=1.0.0, <1.1.6

## Identifiers

- GHSA-jh2m-fhpj-3vr7
- RUSTSEC-2026-0486

## Timeline

- 2026-10-27: disclosed
- 2026-11-11: patched

## References

- [https://crates.io/crates/rustix](https://crates.io/crates/rustix)
- [https://rustsec.org/advisories/RUSTSEC-2026-0486.html](https://rustsec.org/advisories/RUSTSEC-2026-0486.html)

## Related threats

- [rustix's `rustix::fs::Dir` iterator with the `linux_raw` backend can cause memory explosion](https://junglewise.ai/threats/cve-2024-43806-rustix-s-rustix-fs-dir-iterator-with-the-linux-raw-backend-can)
