claude-api
Warn
Audited by Socket on Sep 4, 2026
1 alert found:
SecuritySecuritytemplates/tool-use-advanced.ts
MEDIUMSecurityMEDIUM
templates/tool-use-advanced.ts
The module is a tool-calling example, but it contains a critical security flaw: calculatorTool.run() uses eval() on untrusted input (tool/model-controlled input.expression) without validation or sandboxing. This creates a high likelihood of arbitrary code execution if an attacker can influence tool arguments. Other tools primarily log and return mock data; they do not show direct exfiltration, but they do leak attacker-controlled strings into logs and stdout, increasing data exposure risk. Overall, this code should not be used in any security-sensitive or production context without removing eval and applying strict input/output controls.
Confidence: 78%Severity: 90%
Audit Metadata