claude-agent-sdk
Audited by Socket on May 30, 2026
4 alerts found:
AnomalySecurityx3No direct, explicit malicious payload is present in this module, but it substantially increases security risk by enabling an LLM agent to bypass permissions and run powerful tools (including Bash) within the target directory, while also forwarding nearly all environment variables and injecting untrusted report contents verbatim into the agent prompt. If an attacker can influence the report files, report paths, system prompt, or the environment, this module can become a high-impact sabotage or secret-exposure vector via the agent’s tool access.
No explicit malware logic is visible in this module. However, it creates a high-impact security posture for supply-chain automation: it passes nearly all environment variables to an external agent and enables a Bash-capable, write-capable agent under bypassed permission controls, while embedding multiple potentially attacker-influenced /tmp JSON/log contents directly into the agent prompt. In hostile or loosely controlled CI environments, this combination can plausibly enable prompt-injection-driven command execution and unintended filesystem modifications. Review and harden by restricting allowedTools, removing permission bypass, minimizing env passed to the agent, and validating/sanitizing or isolating /tmp inputs.
No explicit malicious payload is evident in the provided code (no hardcoded credentials, no network exfiltration endpoints, no reverse shells, and subprocess commands are fixed). However, the code delegates powerful capabilities to an LLM-driven agent: it bypasses permissions, allows Bash and filesystem-edit/search tools, runs with cwd in the project directory, and forwards nearly all host environment variables into the agent context. This combination creates a significant supply-chain/automation risk—if local prompt/state content or the agent/system prompt is manipulated, it could enable unintended command execution, file changes, or secret exposure.
The code is not obviously malware (no explicit exfiltration/backdoor/install logic), but it creates a high-impact supply-chain/automation risk by configuring an LLM agent with bypassed permissions and a 'Bash' tool plus powerful file editing capabilities, then feeding it an unvalidated, potentially attacker-controlled change report and nearly the entire process environment. If an attacker can influence CHANGE_REPORT_PATH contents, system-prompt.md, or the environment, the agent could plausibly execute commands or modify files within SKILL_ROOT during an update run.