VAITP Dataset

← Back to the dataset

CVE-2026-115845

Python validator’s incomplete block list lets auth users run arbitrary code via crafted scripts.

  • CVSS 5.3
  • CWE-184
  • Input Validation and Sanitization
  • Remote

An incomplete list of disallowed inputs in the Python code validator of the run_script tool in AWS MCP Server might allow an authenticated remote user to execute arbitrary code within their own isolated session environment via a crafted script. AWS fixed this issue service-side. No customer action is required.

CVSS base score
5.3
Published
2026-10-23
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python

Solution

Upgrade to AWS MCP Server version 3.2.1 (or later), which includes the patched Python code validator.

Vulnerable code sample

import ast

def validate_script(script: str) -> bool:
    # VULNERABLE: incomplete blacklist
    disallowed = ["import os", "subprocess", "__import__"]
    for token in disallowed:
        if token in script:
            return False
    # naive check passes everything else
    return True

def run_script(script: str):
    if not validate_script(script):
        raise ValueError("Disallowed content")
    exec(script, {})

Patched code sample

import ast

def validate_script(script: str) -> bool:
    # FIX: whitelist safe AST nodes
    try:
        tree = ast.parse(script, mode='exec')
    except SyntaxError:
        return False
    for node in ast.walk(tree):
        if isinstance(node, (ast.Import, ast.ImportFrom)):
            for alias in node.names:
                if alias.name != "math":
                    return False
        if isinstance(node, ast.Call):
            if isinstance(node.func, ast.Name) and node.func.id == "__import__":
                return False
            if isinstance(node.func, ast.Attribute) and node.func.attr == "system":
                return False
    return True

def run_script(script: str):
    if not validate_script(script):
        raise ValueError("Disallowed content")
    exec(script, {})

Cite this entry

@misc{vaitp:cve2026115845,
  title        = {{Python validator’s incomplete block list lets auth users run arbitrary code via crafted scripts.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-115845},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115845/}}
}

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.