Intel

AIKIDO-2026-858122

strands-agents-tools is vulnerable to Code Injection

Code Injection Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 2 days ago

75

High Risk

This Affects:

PYTHONstrands-agents-tools
0.6.0 - 0.8.2
Fixed in 0.8.3
Are you affected? Scan for Free

TL;DR

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).

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and use the calculator tool.

Background info

strands-agents-tools is vulnerable to Code Injection in versions 0.6.0 - 0.8.2.

How to fix this

Upgrade the strands-agents-tools library to the patch version.