YAML parser: unchecked node indices in buildTree cause OOB access
まだ誰も着手していません。
評価
調査の方向性
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
- フォーク
- 304
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 ·
-
OS: Linux Type: Bug
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
intel/compute-runtime#1047 ·
-
OS: Windows Type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
intel/compute-runtime#1044 · コメント 1 件 ·
-
難易度 3/5 半日 初心者へのやさしさ 55/100
intel/compute-runtime#1042 ·
intel/compute-runtime の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Segfault when all runs of a Complexity() benchmark are skipped対応中かも @nitanshnagpal が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Code: Performance
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
CrimsonCrossBunker/Cataclysm-Cleanwater-Bomb#1167 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
meshcore-dev/MeshCore#3760 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信