{"id":"GHSA-jh2m-fhpj-3vr7","aliases":["RUSTSEC-2026-0486"],"status":"published","title":"xattr functions mark unwritten bytes as initialized when given a zero-length buffer","description":"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.\n\nPassing 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 `\u0026mut [MaybeUninit\u003cu8\u003e]` the call panics instead.\n\nFrom 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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2026-10-27T12:00:00Z","modified":"2026-11-11T08:45:02Z","fixes":[{"ecosystem":"crates.io","package":"rustix","fixed_in":["1.1.6"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"crates.io","package":"rustix","ranges":[{"type":"SEMVER","events":[{"introduced":"1.0.0"},{"fixed":"1.1.6"}]}]}],"references":[{"url":"https://crates.io/crates/rustix","tags":["package"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0486.html","tags":["advisory"]},{"url":"https://github.com/bytecodealliance/rustix/commit/8e6aaa6713d2bb64b1fdd8c472e3a32a10a76d70","tags":["web"]}],"sources":{"osv":[{"id":"RUSTSEC-2026-0486","title":"xattr functions mark unwritten bytes as initialized when given a zero-length buffer","description":"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.\n\nPassing 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 `\u0026mut [MaybeUninit\u003cu8\u003e]` the call panics instead.\n\nFrom 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.","status":"published","published":"2026-10-27T12:00:00Z","modified":"2026-11-11T08:45:02.466292839Z","updated_at":"2026-11-11T08:57:35.149852Z"}]}}
