ascendc
Audited by Socket on Sep 23, 2026
3 alerts found:
Anomalyx3No malicious behavior is evident. The code implements a legitimate AscendC gather kernel, but it has significant input-validation weaknesses: unchecked indices can cause out-of-bounds global or UB reads, dimensions can produce invalid DMA sizes or buffer calculations, and totalRows == 0 may trigger division by zero in GatherPath. These checks should be enforced by the caller and preferably validated before kernel execution.
No clear malicious or supply-chain attack behavior is present. The code performs the expected device-side indexed data movement and contains no exfiltration, persistence, command execution, or credential access. It does have security-relevant robustness weaknesses: unvalidated indices and dimensions can produce out-of-bounds global-memory accesses, and arithmetic may overflow for invalid large inputs. The large-inner path also drops indices beyond its first batch. These issues should be fixed by validating index ranges and dimensions, checking allocation bounds, using overflow-safe arithmetic, and iterating over all large ranges.
The fragment is a non-malicious Ascend C++ elementwise-kernel template, not a complete implementation. Its primary risks are undefined output due to the missing Compute logic and possible out-of-bounds global-memory access from alignedTailLen unless the caller guarantees sufficient padding. Parameter validation is also absent. No evidence of malware, exfiltration, backdoors, or obfuscation is present.