VAITP Dataset

← Back to the dataset

CVE-2026-63378

Authenticated users can inject arbitrary Python via script_code, achieving root container compromise.

  • CVSS 8.8
  • CWE-94
  • Input Validation and Sanitization
  • Remote

TAKO AI Agent for Okta is a local-first AI agent that helps Okta administrators query tenant data using natural language. Prior to 3.0.1-beta, any authenticated user with a valid `fctr_session` cookie can submit arbitrary Python source in the `script_code` field of `POST /api/react/execute-script`, without administrator privilege. In `src/api/routers/react_stream.py`, the source is stored with `skip_discovery=True`, bypassing AI-based content filtering, and is passed to `validate_generated_code` in `src/utils/security_config.py`. `BLOCKED_PATTERNS` recognizes direct `__import__` calls but misses the import name passed as a string, `getattr` is in `ALLOWED_BUILTINS`, and the AST checker handles `ast.Name` and `ast.Attribute` targets but fails to handle `ast.Call` targets. Dynamic `getattr` call chains through `__builtins__` therefore evade validation. The `_write_temp_script` helper writes the accepted code to disk, and `asyncio.create_subprocess_exec()` executes it as the application process user, which is root in the default container. Command output is returned as Server-Sent Events through `GET /api/react/stream-react-updates?process_id=<id>`. The resulting container compromise can disclose environment secrets including Okta API tokens and the JWT key, expose the SQLite database, and permit backend-service pivoting and persistence. This issue is fixed in version 3.0.1-beta.

CVSS base score
8.8
Published
2026-10-30
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
TAKO AI Agent for Okta

Solution

Upgrade to TAKO AI Agent for Okta v3.0.1‑beta (or later).

Vulnerable code sample

import ast, asyncio, tempfile, os

BLOCKED_PATTERNS = [r'__import__']
ALLOWED_BUILTINS = {'getattr'}

def validate_generated_code(source: str) -> bool:
    tree = ast.parse(source)
    for node in ast.walk(tree):
        if isinstance(node, ast.Call) and isinstance(node.func, ast.Name):
            if node.func.id in BLOCKED_PATTERNS:
                return False
    return True

async def execute_script(script_code: str):
    # VULNERABLE: dynamic import via getattr bypasses validation
    if not validate_generated_code(script_code):
        raise ValueError("Blocked script")
    # write script to temp file
    with tempfile.NamedTemporaryFile('w', delete=False, suffix='.py') as f:
        f.write(script_code)
        script_path = f.name
    # execute as root
    proc = await asyncio.create_subprocess_exec(
        'python', script_path,
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE
    )
    stdout, stderr = await proc.communicate()
    os.unlink(script_path)
    return stdout, stderr

Patched code sample

import ast, asyncio, tempfile, os, importlib

BLOCKED_PATTERNS = [r'__import__']
ALLOWED_BUILTINS = {'getattr'}

def validate_generated_code(source: str) -> bool:
    tree = ast.parse(source)
    for node in ast.walk(tree):
        if isinstance(node, ast.Call):
            # FIX: reject dynamic import patterns in call targets
            if isinstance(node.func, ast.Call) and isinstance(node.func.func, ast.Name):
                if node.func.func.id == 'getattr' and any(
                    isinstance(arg, ast.Str) and arg.s == '__import__' for arg in node.func.args):
                    return False
            if isinstance(node.func, ast.Name) and node.func.id in BLOCKED_PATTERNS:
                return False
    return True

async def execute_script(script_code: str):
    if not validate_generated_code(script_code):
        raise ValueError("Blocked script")
    # write script to temp file
    with tempfile.NamedTemporaryFile('w', delete=False, suffix='.py') as f:
        f.write(script_code)
        script_path = f.name
    # execute as root
    proc = await asyncio.create_subprocess_exec(
        'python', script_path,
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE
    )
    stdout, stderr = await proc.communicate()
    os.unlink(script_path)
    return stdout, stderr

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Harden initial setup and disable direct script replay (fctr-id/okta-ai-agent)
    src/api/main.py · lifespan, src/api/routers/auth.py, src/api/routers/auth.py · check_setup_status, src/api/routers/auth.py · initial_setup, src/api/routers/react_stream.py · execute_script_directly

Cite this entry

@misc{vaitp:cve202663378,
  title        = {{Authenticated users can inject arbitrary Python via script_code, achieving root container compromise.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-63378},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-63378/}}
}

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.