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

未关闭
#3,517 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

The issue describes an unsound zero-length-buffer case in rustix’s xattr functions, but gives no ev-node file or test to start from. Read the linked rustix advisory and inspect the dependency usage in ev-node; confirm whether ev-node uses affected rustix versions or reaches these functions. Done means establishing whether this issue applies to ev-node and, if so, identifying the affected use.

由索引模型根据 Issue 内容生成。

描述

Details
Package rustix
Version 1.1.4
Warning unsound
URL https://github.com/bytecodealliance/rustix/commit/8e6aaa6713d2bb64b1fdd8c472e3a32a10a76d70
Patched Versions >=1.1.6
Unaffected Versions <1.0.0
Aliases GHSA-jh2m-fhpj-3vr7

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.

主要语言
Go
星标
362
派生
295
平均合并
9 小时 29 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

evstack/ev-node 的其他 Issue

查看 evstack/ev-node 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。