---
title: "CVE-2026-77309: AIT-GUI Route Chain Enables Unauthenticated Python"
slug: "cve-2026-77309-ait-gui-unauthenticated-python-execution"
description: "Defensive teardown of CVE-2026-77309 in AIT-GUI versions 1.0.0 through 2.5.0, covering the /tlm/query to /script/run chain, mitigations, and patch verification."
author: "Hamdi Soudani"
category: "ai-security-jailbreaks"
archetype: "advisory-teardown"
published_at: "2026-11-24T18:02:57.724+00:00"
updated_at: "2026-11-24T18:02:57.834259+00:00"
canonical_url: "https://pyvren.com/blog/cve-2026-77309-ait-gui-unauthenticated-python-execution"
reading_time_minutes: 3
word_count: 561
quality_score: 91
tags: ["cve-2026-77309","ait-gui","ai-security-jailbreaks"]
keywords: ["ait-gui unauthenticated python execution","cve-2026-77309 patch verification","script path containment python server","ghsa-jrjx-9jjw-747m mitigation","owasp llm top 10 indirect prompt injection defense"]
sources: ["https://github.com/advisories/GHSA-jrjx-9jjw-747m","https://advisories.gitlab.com/pypi/ait-gui/CVE-2026-77309/","https://radar.offseq.com/threat/ait-gui-route-chain-allows-unauthenticated-python-execution-in-server-process-cve-2026-77309-a8cf5f5f15219da0"]
---

# CVE-2026-77309: AIT-GUI Route Chain Enables Unauthenticated Python

> **TL;DR:** Upgrade AIT-GUI to 2.5.1 or apply path containment and session validation to block unauthenticated arbitrary Python execution via /tlm/query and /script/run.

## Key Facts

- **Affected versions:** ait-gui >= 1.0.0, <= 2.5.0 ([source](https://github.com/advisories/GHSA-jrjx-9jjw-747m))
- **Patched version:** 2.5.1 ([source](https://github.com/advisories/GHSA-jrjx-9jjw-747m))
- **CVSS 3.1 base score:** 8.8 High (AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) ([source](https://radar.offseq.com/threat/ait-gui-route-chain-allows-unauthenticated-python-execution-in-server-process-cve-2026-77309-a8cf5f5f15219da0))
- **CWEs:** CWE-22 Improper Limitation of a Pathname to a Restricted Directory; CWE-459 Incomplete Cleanup ([source](https://advisories.gitlab.com/pypi/ait-gui/CVE-2026-77309/))
- **EPSS 30-day exploitation probability:** 1.0% ([source](https://radar.offseq.com/threat/ait-gui-route-chain-allows-unauthenticated-python-execution-in-server-process-cve-2026-77309-a8cf5f5f15219da0))

## Threat Model & Attack Surface Matrix

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) affects AIT-GUI versions 1.0.0 through 2.5.0 and permits unauthenticated remote code execution on the server process. The vulnerability chains two HTTP routes: POST /tlm/query writes attacker-controlled fields into fields_in.txt under the static directory, and POST /script/run reads that file and executes it as Python. Because /script/run lacks the path containment check present on nearby /scripts/load/, an attacker can traverse outside the configured script directory and execute arbitrary code with daemon privileges. CVSS 3.1 scores this at 8.8 High with adjacent network access, low complexity, no privileges, and no user interaction.

| Attack Surface | Blast Radius | Concrete Control |
| --- | --- | --- |
| POST /tlm/query fields parameter | Arbitrary file write to static directory | Validate and sanitize fields; write to isolated temp directory outside static root |
| POST /script/run scriptPath parameter | Arbitrary Python execution as server daemon | Enforce realpath containment under ScriptRoot; require authenticated session |
| GET / session cookie issuance | Unauthenticated session establishment | Rate-limit cookie issuance; bind sessions to trusted clients |
| Static temp file fields_in.txt | Incomplete cleanup enables script injection | Delete temp files on all error paths; use non-executable temp directories |

![CVE-2026-77309: AIT-GUI route chain allows unauthenticated Python execution | Threat Radar](https://radar.offseq.com/api/og.png?title=CVE-2026-77309%3A+AIT-GUI+route+chain+allows+unauthenticated+Python+execution+in+server+process&severity=high&id=CVE-2026-77309&cvss=8.8&v=7c7572f2)

## Why Naive Prompt Filters Fail

This defect is not a prompt injection problem in the LLM sense, so input filtering on natural-language prompts does not address it. The root cause is a server-side path traversal and incomplete cleanup chain. A WAF or prompt filter inspecting HTTP bodies cannot reliably distinguish a legitimate script path from a traversal payload when the application joins user input to ScriptRoot without canonicalization. Furthermore, the temporary file is written by /tlm/query before /script/run is ever called, so filtering the second request misses the initial write primitive. Defense must occur at the application layer, not at a content-filter layer.

## Defense-in-Depth & Sandbox Isolation Architecture

Patch to AIT-GUI 2.5.1 immediately. Until patching is complete, place the service behind an authentication proxy that requires a valid session before any POST to /script/run. Enforce path containment by resolving scriptPath with realpath and verifying the result starts with the configured ScriptRoot. Never write user-controlled fields to files under the static directory; use a dedicated temporary directory with the no-execution mount option. Run the AIT-GUI daemon as an unprivileged user inside a container or sandbox with no network egress to internal metadata services. These controls reduce blast radius even if a future route-chain defect appears.

## Runnable Guardrail Policy / Verification Code

```python
import os
from pathlib import Path
from flask import request, abort, session

SCRIPT_ROOT = Path("/opt/ait-gui/scripts").resolve()
TEMP_ROOT = Path("/var/tmp/ait-gui").resolve()

def safe_script_path(user_path: str) -> Path:
    candidate = (SCRIPT_ROOT / user_path).resolve()
    if SCRIPT_ROOT not in candidate.parents and candidate != SCRIPT_ROOT:
        abort(403, "script path escapes ScriptRoot")
    if not candidate.exists():
        abort(404, "script not found")
    return candidate

def require_auth() -> None:
    if not session.get("authenticated"):
        abort(401, "authentication required")

@app.route("/script/run", methods=["POST"])
def run_script():
    require_auth()
    script_path = safe_script_path(request.form.get("scriptPath", ""))
    # Execute only validated scripts under ScriptRoot
    ...

@app.route("/tlm/query", methods=["POST"])
def tlm_query():
    fields = request.form.get("fields", "")
    tmp_file = TEMP_ROOT / "fields_in.txt"
    tmp_file.parent.mkdir(parents=True, exist_ok=True)
    tmp_file.write_text(fields)
    try:
        # query logic
        pass
    finally:
        tmp_file.unlink(missing_ok=True)
```

Verify the patch by checking the installed package version:

```bash
pip show ait-gui | grep Version
# Expected: Version: 2.5.1
```

Confirm that /script/run rejects traversal paths and that /tlm/query no longer leaves fields_in.txt in the static directory after error responses.

## Operational Tradeoffs & False-Positive Budget

Adding authentication to /script/run may break internal automation that calls the route without sessions. Update service accounts or issue short-lived tokens before enforcing auth. Path containment checks add minimal latency, typically under 1 millisecond per request on local filesystems. Writing to /var/tmp instead of the static directory changes file permissions and may require SELinux policy updates. Monitor 403 and 404 responses from /script/run to tune the false-positive budget; legitimate scripts moved outside ScriptRoot will break until paths are corrected.

When not to use this guidance: if you cannot upgrade to 2.5.1 and must run an affected version, isolate the host completely and do not expose it to untrusted networks. The mitigations above reduce risk but do not replace the vendor patch.

[GitHub Advisory GHSA-jrjx-9jjw-747m](https://github.com/advisories/GHSA-jrjx-9jjw-747m)
[GitLab Advisory Database CVE-2026-77309](https://advisories.gitlab.com/pypi/ait-gui/CVE-2026-77309/)
[Threat Radar CVE-2026-77309 Record](https://radar.offseq.com/threat/ait-gui-route-chain-allows-unauthenticated-python-execution-in-server-process-cve-2026-77309-a8cf5f5f15219da0)

## Frequently Asked Questions

### Does CVE-2026-77309 require authentication to exploit?

No. The advisory states that unauthenticated callers can obtain a session cookie through GET / and then issue POST /script/run to execute arbitrary Python with daemon privileges.

### Which AIT-GUI versions are affected by GHSA-jrjx-9jjw-747m?

All versions from 1.0.0 through 2.5.0 are affected; version 2.5.1 contains the fix.

### What is the primary defensive control for this vulnerability?

Upgrade to AIT-GUI 2.5.1, enforce script path containment under ScriptRoot, validate sessions on /script/run, and avoid writing attacker-controlled content to static temp files.

## Primary Sources

- https://github.com/advisories/GHSA-jrjx-9jjw-747m
- https://advisories.gitlab.com/pypi/ait-gui/CVE-2026-77309/
- https://radar.offseq.com/threat/ait-gui-route-chain-allows-unauthenticated-python-execution-in-server-process-cve-2026-77309-a8cf5f5f15219da0
