Skip to content
CVE-2026-77312 Microsoft Sentinel · KQL

Detect Flyto2 Core Arbitrary File Write via Unguarded data.*/file.* Modules (CVE-2026-77312) in Microsoft Sentinel

Detects exploitation of CVE-2026-77312, a critical (CVSS 10.0) path traversal / arbitrary file write vulnerability in the pip package flyto-core (<= 2.26.7). The vulnerability is an incomplete fix of CVE-2026-67429: the data.* and file.* modules fail to sanitise attacker-controlled destination paths, allowing '..' sequences or absolute paths to write arbitrary files outside the intended directory. Successful exploitation enables webshell drops, cron/systemd persistence, SSH key injection, or overwrite of application code leading to remote code execution. Detection focuses on Python processes loading flyto-core writing files to sensitive paths, traversal patterns in request bodies to flyto endpoints, and newly created executable/config files by the application service account.

MITRE ATT&CK

Tactic
Initial Access Execution Persistence

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// df00tech DF00-9b5c572b8d · https://df00tech.com/detections/CVE-2026-77312 · licence: https://df00tech.com/detections/licence
let sensitivePaths = dynamic(["/etc/cron", "/etc/systemd", "/var/www", "/.ssh/", "authorized_keys", "/usr/lib/python", "site-packages", "wwwroot", "\\startup\\"]);
DeviceFileEvents
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where InitiatingProcessFileName in~ ("python", "python3", "gunicorn", "uwsgi", "uvicorn") or InitiatingProcessCommandLine has "flyto"
| where (FolderPath has_any (sensitivePaths)) or (FolderPath has "..")
| where FileName endswith ".py" or FileName endswith ".sh" or FileName endswith ".php" or FileName endswith ".jsp" or FileName endswith ".service" or FileName has "authorized_keys" or FileName endswith ".aspx"
| project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessCommandLine, FolderPath, FileName, ActionType, InitiatingProcessId
| order by Timestamp desc
critical severity medium confidence

Flags file create/modify events by Python/WSGI processes running flyto-core that land in sensitive OS, web-root, SSH or python-package paths, or whose path contains traversal sequences.

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceFileEvents

False Positives & Tuning

  • Legitimate flyto-core data export jobs writing to a configured output directory
  • Application deployment or package upgrade processes writing to site-packages
  • Backup or sync agents impersonating the service account

Other platforms for CVE-2026-77312


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Simulated path traversal file write via flyto-core file module

    Expected signal: File creation event for /tmp/flyto_poc_shell.php with initiating process python3 and a path containing '..'.

  2. Test 2 Cron persistence via flyto-core arbitrary write

    Expected signal: File creation under /etc/cron.d by a python3 process.

  3. Test 3 SSH key injection via traversal write

    Expected signal: File modification of /root/.ssh/authorized_keys by a python3 process.


Response Playbook

Triage

  1. Confirm the affected host runs flyto-core and determine its version with `pip show flyto-core`; any version <= 2.26.7 is vulnerable.
  2. Review the written file identified in the alert: inspect path, owner, timestamps and contents for webshell, persistence or key-injection indicators.
  3. Correlate the file write with inbound HTTP requests to flyto data.* / file.* endpoints in the same time window, looking for '..', URL-encoded traversal (%2e%2e) or absolute destination paths in request bodies.
  4. Determine whether the written file was subsequently executed or loaded (process spawn, cron fire, service start, SSH auth using the dropped key).

Containment

  1. Isolate the affected host from the network to prevent webshell interaction or lateral movement.
  2. Upgrade flyto-core to 2.26.8 or later; if immediate patching is impossible, restrict the data.*/file.* endpoints at the reverse proxy/WAF and run the service as an unprivileged user with a read-only code directory.
  3. Remove or quarantine any attacker-dropped files (webshells, cron entries, systemd units, authorized_keys additions).

Evidence Collection

  1. Preserve the dropped file(s), auditd/Sysmon file-event records, and the flyto-core application/access logs covering the write.
  2. Capture the full HTTP request that triggered the write, including headers and body, from the web server or WAF logs.
  3. Snapshot process listings, cron tables, systemd units, and ~/.ssh/authorized_keys for the service account before remediation.

Escalation Criteria

  • !Escalate to IR if the dropped file was executed, a webshell responded, or a reverse shell/outbound C2 was observed.
  • !Escalate if traversal reached system-critical paths (/etc, site-packages, SSH keys) or if multiple hosts show the same pattern indicating active campaign exploitation.

Investigation Guide

Forensic Artifacts

  • >Newly created or modified files with mismatched owner/timestamp in web root, /etc/cron*, /etc/systemd, site-packages or ~/.ssh.
  • >flyto-core application logs containing data.*/file.* calls with traversal or absolute destination paths.
  • >Web server access logs showing requests with %2e%2e or absolute paths to flyto endpoints.

Tuning Guidance

Baseline the legitimate output directories that flyto-core data export jobs write to and exclude those exact paths while keeping traversal ('..') and sensitive-path matches active. Scope the process list to the actual WSGI server used in your environment to cut noise, and whitelist your deployment pipeline's service account when it writes to the code directory on release.


Hunting Queries

Hunt for flyto-core traversal file writes and inbound traversal requests to flyto endpoints across endpoint and web telemetry.

Hunting — KQL
kql
// df00tech DF00-9b5c572b8d · https://df00tech.com/detections/CVE-2026-77312 · licence: https://df00tech.com/detections/licence
DeviceFileEvents | where InitiatingProcessFileName in~ ("python","python3","gunicorn","uwsgi") | where FolderPath has ".." or FolderPath has_any ("/etc/cron","authorized_keys","site-packages") | summarize count() by DeviceName, FolderPath, FileName, bin(Timestamp, 1h)
Hunting — SPL
spl
``` df00tech DF00-9b5c572b8d · https://df00tech.com/detections/CVE-2026-77312 · licence: https://df00tech.com/detections/licence ```
index=web sourcetype=*access* uri="*flyto*" (uri="*..*" OR uri="*%2e%2e*" OR form_data="*../*") | stats count by src_ip, uri, status

Atomic Red Team Tests

Test 1 Simulated path traversal file write via flyto-core file module
linux

Emulates the vulnerable file.* module writing an attacker-controlled path containing traversal to drop a marker file outside the intended directory.

Command

bash
mkdir -p /tmp/flyto_data && cd /tmp/flyto_data && python3 -c "dest='../../../../tmp/flyto_poc_shell.php'; open(dest,'w').write('<?php echo \"poc\"; ?>'); print('wrote', dest)"

Cleanup

bash
rm -f /tmp/flyto_poc_shell.php; rm -rf /tmp/flyto_data

Expected Telemetry

File creation event for /tmp/flyto_poc_shell.php with initiating process python3 and a path containing '..'.

Expected Detection

KQL/SPL rules match on python3 writing a .php file with traversal in the path.

Test 2 Cron persistence via flyto-core arbitrary write
linux

Simulates abusing the traversal write to drop a cron job for persistence.

Command

bash
python3 -c "open('/etc/cron.d/flyto_poc','w').write('* * * * * root /bin/true\n')"

Cleanup

bash
rm -f /etc/cron.d/flyto_poc

Expected Telemetry

File creation under /etc/cron.d by a python3 process.

Expected Detection

Detection fires on python-initiated write to /etc/cron* sensitive path.

Test 3 SSH key injection via traversal write
linux

Simulates writing to authorized_keys via the unguarded file module to enable persistent access.

Command

bash
mkdir -p /root/.ssh && python3 -c "open('/root/.ssh/authorized_keys','a').write('ssh-ed25519 AAAATESTPOCKEY poc@attacker\n')"

Cleanup

bash
sed -i '/poc@attacker/d' /root/.ssh/authorized_keys

Expected Telemetry

File modification of /root/.ssh/authorized_keys by a python3 process.

Expected Detection

Rules match on python writing/modifying an authorized_keys file.

Related Detections