YAML parser: unchecked node indices in buildTree cause OOB access
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 1.5k
- Fork
- 306
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của intel/compute-runtime
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
intel/compute-runtime#1040 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
intel/compute-runtime#943 ·
-
OS: Linux Type: Bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
intel/compute-runtime#1047 ·
-
OS: Windows Type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
intel/compute-runtime#1044 · 1 bình luận ·
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
intel/compute-runtime#1042 ·
Tất cả issue của intel/compute-runtime
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
eic/TimeframeBuilder#102 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
error not reported I/O low priority rt_lib
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[XLA] hlo/pass/README.md says passes implement Run; since the NVI change they implement RunImplĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
objectionary/game-of-life#78 ·