strands-agents-tools is vulnerable to Code Injection
75
High Risk
The calculator tool validates expressions against an AST allowlist that is meant to permit only mathematical syntax and block code execution. String literals were still allowed as arguments, and several SymPy helpers reachable in the evaluation namespace (for example N, simplify, solve) re-parse string arguments through sympify, which evaluates them with full builtins and escapes the restricted namespace used for the top-level expression. An expression such as N("__import__('os').system('id')") therefore executed arbitrary code despite the allowlist. The fix rejects string literals except as positional arguments to a small allowlist of safe constructors (Symbol, symbols, Rational, Integer, Float).
You are affected if you are using a version that falls within the vulnerable range and use the calculator tool.
strands-agents-tools is vulnerable to Code Injection in versions 0.6.0 - 0.8.2.
Upgrade the strands-agents-tools library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant