RUSTSEC-2026-0486: xattr functions mark unwritten bytes as initialized when given a zero-length buffer

Ouverte
#447 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
rust
Domaine
backend, security

Piste de recherche

The report identifies unsound extended-attribute functions in rustix and says the issue is fixed from version 1.1.6. Start by checking how this repository depends on rustix and whether it uses the listed xattr functions; the payload names no repository files or tests. Done means the affected dependency or usage is addressed and the zero-length buffer case no longer permits unwritten bytes to be treated as initialized.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Details
Status unsound
Package rustix
Version 1.1.4
URL https://github.com/bytecodealliance/rustix/commit/8e6aaa6713d2bb64b1fdd8c472e3a32a10a76d70
Date 2026-10-27

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.

See advisory page for additional details.

Langage dominant
Rust
Étoiles
18
Forks
5
Merge moyen
1 j 11 h
PR mergées (30 j)
60

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de hyperlight-dev/hyperlight-js

Toutes les issues de hyperlight-dev/hyperlight-js

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.