memory-management
Audited by Socket on Aug 14, 2026
2 alerts found:
Anomalyx2This file primarily acts as a subprocess-based hook runner. The most significant security exposure is that it can execute an arbitrary Node script determined by the unvalidated environment variable AI_MEMORY_SCRIPT; combined with full environment passthrough (env: process.env) and forwarding of untrusted prompt/config text as CLI arguments, this creates a high-impact supply-chain/sandboxing risk in threat models where attackers can influence environment variables or the executed child script. The wrapper itself shows no direct malware behaviors, but it materially increases the likelihood of compromise through controllable child execution.
No explicit obfuscation or direct malicious payload is visible in this fragment. However, it provides a powerful request-driven execution bridge: it parses untrusted input and, for recognized tool calls, spawns a Node.js child script with attacker-controlled CLI flags and a potentially attacker-influenced working directory, while also passing through the entire environment. The security impact and likelihood of malicious behavior depend heavily on the unseen toolCommands/memoryScript implementation and any access control, which are not fully shown. From this snippet alone, the dominant concern is abuse of the spawned child’s behavior and potential data leakage via returned stdout/stderr.