[GSD-14017] YAML parser: unchecked node indices in buildTree cause OOB access
还没有人认领这个 Issue。
评估
调研方向
Start with NEO::Yaml::buildTree in shared/source/device_binary_format/yaml/yaml_parser.cpp (around line 360) and the YamlParser class in yaml_parser.h, tracing where invalidNodeID is compared against the NodesCache indices. Then check how level_zero/core/source/module/modules_package_binary.cpp passes untrusted YAML into the parser. Done means that every node index is bounds-checked before use and a crafted-input test no longer crashes; the report's three claims should be reproduced before fixing.
由索引模型根据 Issue 内容生成。
描述
Problem
NEO::Yaml::buildTree (shared/source/device_binary_format/yaml/yaml_parser.cpp, line 360) and the YamlParser class (yaml_parser.h) use NodeId indices to navigate a NodesCache (vector of Node). Multiple paths use invalidNodeID (std::numeric_limits<NodeId>::max()) as a sentinel, but the value is also used as an array index before being checked.
Three bugs from the same root cause:
1. DEADLYSIGNAL (crash) at yaml_parser.h:502
buildTree is called with crafted token data. A node index that should be invalidNodeID is instead used to access nodes[], reading past the vector bounds. Process crashes with SIGSEGV.
2. Container out-of-bounds
A crafted input produces a nodeOrdinal or childId that exceeds outNodes.size(). The nodes[childId] access at lines like 504 reads past the vector.
3. Stack buffer overflow at yaml_parser.h:502
Token scanning does not check for NUL termination in all paths. A crafted input causes buildTree to write past a stack-allocated buffer during token processing.
All three are triggered through ModulesPackageBinary::decode (level_zero/core/source/module/modules_package_binary.cpp) which feeds untrusted module binary data into the YAML parser.
Impact
Crash (denial of service). Reachable through zeModuleCreate (Level Zero) when the module binary contains a YAML manifest section. A crafted program binary triggers OOB access in the YAML parser during module loading.
Suggested fix
- Validate all
NodeIdvalues againstoutNodes.size()before using them as indices. - Add NUL-termination checks in token scanning paths.
- Validate
buildTreeoutput node count against input token count as a sanity bound.
Found by BrightSec automated security scanning.
- 主要语言
- C++
- 星标
- 1.5k
- 派生
- 306
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
intel/compute-runtime 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
intel/compute-runtime#1040 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
intel/compute-runtime#943 ·
-
难度 4/5 3-5 天 新手友好度 35/100
intel/compute-runtime#1051 ·
-
OS: Linux Type: Bug
难度 4/5 3-5 天 新手友好度 53/100
intel/compute-runtime#1050 ·
-
难度 4/5 3-5 天 新手友好度 48/100
intel/compute-runtime#1049 ·
查看 intel/compute-runtime 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Niko1221/Strata#5560 · 2 条评论 ·
维护者通常 4 天内回复
-
NVIDIA windows
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
要トリアージ 辞書
难度 1/5 1-3 小时 新手友好度 86/100
yksr-melt/Meltype#1625 · 1 个 reaction ·
维护者通常 1 天内回复
-
kind/bug priority/medium qa_automation
难度 2/5 1-3 小时 新手友好度 78/100
yugabyte/yugabyte-db#37324 ·
维护者通常 1 天内回复