sprite-gen
Audited by Socket on Oct 4, 2026
3 alerts found:
Anomalyx3The fragment is a readable asset-loading module with no evident malware, exfiltration, backdoor, or code-execution behavior. It contains a path traversal/arbitrary local file read risk if JSON descriptors are untrusted, because referenced paths are resolved without directory containment checks. Use trusted descriptors or enforce that resolved references remain under an approved asset directory; consider limits on descriptor size, frame count, and total decoded memory.
No explicit embedded malware, obfuscation, or direct data theft is evident in this file. However, the module introduces a substantial security risk because it executes a caller-supplied provider command template on the host (arbitrary process execution potential) and performs destructive filesystem operations when preserving the best-candidate directory. If --provider-command (or the inputs that shape it) can be influenced by an untrusted party, this can be leveraged for sabotage or execution of attacker-controlled code; additionally, the actual inspection/scoring behavior is delegated to imported modules that are not shown here.
No strong evidence of intentional malware/backdoor behavior in this code fragment. The dominant security concern is DOM-based injection/XSS risk stemming from wrap.innerHTML using interpolated translation strings (including insertion into an attribute context) without visible, context-specific escaping/sanitization. Secondary concerns are robustness/availability: unvalidated grid dimensions/shape and heavy memory use from large images and generated base64 data URLs, plus potential CORS-related failures during canvas readback. If translation content and run.baseUrl/grid inputs are fully trusted and properly sanitized/validated elsewhere, the risk decreases; otherwise, prioritize hardening around innerHTML usage and input validation.