VAITP Dataset

← Back to the dataset

CVE-2026-78379

LLM prompt injection in python_repl lets attackers run arbitrary Python code before 0.8.5.

  • CVSS 9.2
  • CWE-94 (inferred)
  • Input Validation and Sanitization
  • Remote

Improper neutralization of input used for LLM prompting in the python_repl tool in Amazon Strands Agents Tools before 0.8.5 might allow remote actors to execute arbitrary Python code on the agent's host by bypassing the human consent gate, via a crafted prompt that forwards non_interactive_mode as a keyword argument through the batch tool. To remediate this issue, users should upgrade to version 0.8.5 or later.

CWE
CWE-94 (inferred)
CVSS base score
9.2
Published
2026-08-25
OWASP
A03 Injection
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade the Amazon Strands Agents Tools package to version 0.8.5 or newer.

Vulnerable code sample

import json
from strands_agents_tools import python_repl

def execute_user_prompt(prompt: str, **kwargs):
    """
    Executes a user supplied prompt via the python_repl tool.
    The **kwargs are forwarded directly, allowing a crafted prompt to
    inject `non_interactive_mode=True` and bypass the consent gate.
    """
    # VULNERABLE: forwards unvalidated kwargs to python_repl, enabling code injection
    result = python_repl.run(prompt, **kwargs)
    return json.dumps({"output": result})

Patched code sample

import json
from strands_agents_tools import python_repl

def execute_user_prompt(prompt: str, **kwargs):
    """
    Executes a user supplied prompt via the python_repl tool.
    Only a whitelist of safe keyword arguments is allowed.
    """
    # FIX: filter kwargs to allowed keys, discarding non_interactive_mode
    allowed_keys = {"timeout", "max_iterations"}
    safe_kwargs = {k: v for k, v in kwargs.items() if k in allowed_keys}
    result = python_repl.run(prompt, **safe_kwargs)
    return json.dumps({"output": result})

Cite this entry

@misc{vaitp:cve202678379,
  title        = {{LLM prompt injection in python_repl lets attackers run arbitrary Python code before 0.8.5.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-78379},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-78379/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.