YAML parser: unchecked node indices in buildTree cause OOB access
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 1.5k
- Fork
- 306
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di intel/compute-runtime
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
intel/compute-runtime#1040 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
intel/compute-runtime#943 ·
-
OS: Linux Type: Bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
intel/compute-runtime#1047 ·
-
OS: Windows Type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
intel/compute-runtime#1044 · 1 commento ·
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
intel/compute-runtime#1042 ·
Tutte le issue di intel/compute-runtime
Issue simili
-
Linux npm packaging leaves workspace files that block subsequent CI checkoutForse già presa @Spockkk0225 l’ha presa oggi. Apertaci
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
alibaba/neug#1195 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
QA/No release-notes/exclude tests tests/missing-coverage tests/test-quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
brave/brave-browser#61019 ·
I maintainer di solito rispondono entro 1 giorno
-
? - Needs Triage bug CUTLASS C++
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 4 giorni