Summary
AIT GUI has a chained file-handling vulnerability: telemetry query data can remain in a file after an error, and the script-running route can read and execute a Python file outside its intended directory. A network-reachable attacker may combine these behaviors to run arbitrary code with the privileges of the AIT-GUI server process.
Affected context
The issue affects AIT GUI versions from 1.0.0 through 2.5.1 in the telemetry query and script-running routes. The risk arises when attacker-controlled telemetry field data is written to a file that remains after a no-PCAP error, while the script route accepts paths that resolve outside ScriptRoot and executes the selected file as Python.
Exploit preconditions
- Attack surface: Network-accessible AIT GUI HTTP routes
- Required access: The described attack does not require credentials; the attacker can obtain an ordinary session cookie without authentication.
- Trigger points: A POST to
/tlm/querythat reaches the no-PCAP error path, followed by use of the/script/runroute. - Why exploitation is possible: The error path may leave attacker-controlled data in
fields_in.txt, and the script route does not constrain resolved paths to ScriptRoot before reading and executing a file.
Why this happens
The issue combines inadequate path containment with incomplete cleanup of a temporary file. Accepting a script path without verifying that its resolved location remains within the approved script directory maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). Failing to remove temporary data on an error path maps to CWE-459: Incomplete Cleanup. Together, these behaviors can expose attacker-controlled content to a route that executes files as Python.
Potential impact
- An attacker could execute arbitrary Python code with the AIT-GUI server process's privileges.
- The server process or data accessible to it may be compromised.
- A compromised server could be used to disrupt telemetry monitoring or mission operations.
- Further access may be possible if the server has permissions or network reach beyond its intended role.
General mitigation guidance
Defensive patterns include:
- Restrict script selection to server-defined identifiers or an explicit allowlist rather than accepting arbitrary paths.
- Resolve and validate paths against the approved script directory before any file is read or executed.
- Avoid executing user-influenced or otherwise untrusted files as code; use constrained, non-executable data formats where appropriate.
- Ensure temporary files are removed on every success and error path, such as through reliable cleanup mechanisms.
- Reduce trust in request-supplied fields and apply strict input validation.
- Run the GUI with least-privilege permissions and isolate script execution from sensitive resources where feasible.
How teams detect issues like this
- Use static analysis to flag request-controlled paths passed to file reads or execution APIs without canonicalization and directory-containment checks.
- Review error handling for temporary files, especially whether cleanup occurs on exceptions and early returns.
- Examine route authentication and session-cookie behavior, including routes intended to be unauthenticated.
- Enforce policies that prohibit executing files selected through untrusted request parameters and require explicit script allowlists.
- Monitor for unexpected script execution and file access outside approved script directories. Automated code review tools may help identify these patterns.

