MclDecoder::parseSymbols: unchecked shndx used as index into elfSh array
还没有人认领这个 Issue。
评估
调研方向
从 level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp 中第 329 行左右的 MclDecoder::parseSymbols 开始,这里 elfSymbol.shndx 在没有边界检查的情况下索引 program.elfSh。阅读第 199 行附近从节头表构建 program.elfSh 的代码,以确认其大小。完成的标准是:对越界的 shndx 进行保护,使该符号被跳过或拒绝,且不会读取超出数组的内容,并附有能够覆盖该路径的测试或构造的输入。
由索引模型根据 Issue 内容生成。
描述
Problem
MclDecoder::parseSymbols (level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp, line 329) uses elfSymbol.shndx as an index into program.elfSh without bounds checking:
symbol.section = static_cast<Sections::SectionType>(program.elfSh[elfSymbol.shndx].type);
program.elfSh is an ArrayRef constructed from the ELF section header table (line 199). shndx is a 16-bit field from the ELF symbol table, fully attacker-controlled in a crafted binary. If shndx >= program.elfSh.size(), this is an out-of-bounds read at an attacker-chosen index.
UBSan fires on the pointer arithmetic computing the OOB address.
Impact
Out-of-bounds read in the MCL (Mutable Command List) program decoder. Reachable through zexCommandListLoadNativeBinary (Level Zero experimental API). Crash or potential information disclosure from reading memory at an attacker-controlled offset from the section header array.
Suggested fix
Check elfSymbol.shndx < program.elfSh.size() before the array access. Skip or error on the symbol if out of bounds.
Found by BrightSec automated security scanning.
- 主要语言
- C++
- 星标
- 1.5k
- 派生
- 304
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
intel/compute-runtime 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
intel/compute-runtime#943 ·
-
OS: Windows Type: Bug
难度 4/5 3-5 天 新手友好度 18/100
intel/compute-runtime#1044 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
intel/compute-runtime#1043 ·
-
难度 3/5 半天 新手友好度 55/100
intel/compute-runtime#1042 ·
-
难度 3/5 半天 新手友好度 55/100
intel/compute-runtime#1041 ·
查看 intel/compute-runtime 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
-
难度 1/5 1 小时以内 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 72/100
eclipse-score/lifecycle#929 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
colbymchenry/codegraph#3223 ·
维护者通常 1 天内回复