CVE-2026-77309
Unauthenticated POST routes allow remote file read & arbitrary Python execution.
- CVSS 8.8
- CWE-22
- Authentication, Authorization, and Session Management
- Remote
AIT GUI provides a framework for building custom websites for real-time telemetry monitoring, commanding, and other mission operations. From 1.0.0 until 2.5.1, POST /tlm/query in ait/gui/__init__.py writes attacker-controlled field data to fields_in.txt, and its no-PCAP error path can abort before deleting that file. The unauthenticated POST /script/run route accepts a scriptPath that resolves outside ScriptRoot, reads the selected file, and executes it as Python. A network-reachable attacker can obtain the ordinary session cookie without credentials, combine the two routes, and execute arbitrary Python code with the AIT-GUI server process privileges. This issue is fixed in version 2.5.1.
- CWE
- CWE-22
- CVSS base score
- 8.8
- Published
- 2026-11-20
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Privilege Escalation
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ait
- Fixed by upgrading
- Yes
Solution
Upgrade AIT‑GUI to version 2.5.1 or later.
Vulnerable code sample
import os
from flask import Flask, request, abort, send_file
app = Flask(__name__)
SCRIPT_ROOT = "/opt/ait/scripts"
@app.route('/tlm/query', methods=['POST'])
def tlm_query():
# VULNERABLE: writes attacker data to a temp file without cleanup on error
data = request.form.get('field')
tmp_path = "/tmp/fields_in.txt"
try:
with open(tmp_path, "w") as f:
f.write(data)
# further processing...
except Exception:
# abort before cleanup, leaving file behind
abort(500)
finally:
os.remove(tmp_path)
return "OK"
@app.route('/script/run', methods=['POST'])
def run_script():
# VULNERABLE: path traversal allowing execution of arbitrary files
script_path = request.form.get('scriptPath')
full_path = os.path.join(SCRIPT_ROOT, script_path) # no validation
try:
with open(full_path, "r") as f:
code = f.read()
exec(code, {})
except Exception as e:
abort(500)
return "Executed"Patched code sample
import os
from flask import Flask, request, abort, send_file
app = Flask(__name__)
SCRIPT_ROOT = "/opt/ait/scripts"
@app.route('/tlm/query', methods=['POST'])
def tlm_query():
# FIX: ensure temp file is always removed even on error
data = request.form.get('field')
tmp_path = "/tmp/fields_in.txt"
try:
with open(tmp_path, "w") as f:
f.write(data)
# further processing...
except Exception:
abort(500)
finally:
try:
os.remove(tmp_path)
except FileNotFoundError:
pass
return "OK"
@app.route('/script/run', methods=['POST'])
def run_script():
# FIX: validate scriptPath to stay within SCRIPT_ROOT
script_path = request.form.get('scriptPath')
# reject absolute paths or path traversal components
if os.path.isabs(script_path) or ".." in script_path.split(os.path.sep):
abort(400)
full_path = os.path.abspath(os.path.join(SCRIPT_ROOT, script_path))
if not full_path.startswith(os.path.abspath(SCRIPT_ROOT) + os.path.sep):
abort(400)
try:
with open(full_path, "r") as f:
code = f.read()
exec(code, {})
except Exception:
abort(500)
return "Executed"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.
- Restrict script execution paths and avoid static temp files (NASA-AMMOS/AIT-GUI)
ait/gui/__init__.py,ait/gui/__init__.py · handle_script_run_post,ait/gui/__init__.py · handle_tlm_query_post
Cite this entry
@misc{vaitp:cve202677309,
title = {{Unauthenticated POST routes allow remote file read & arbitrary Python execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-77309},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-77309/}}
}
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 ::
