CVE-2026-61539 — Vulnerability in xinference — CVE Details
Xinference vulnerable to remote code execution via unsafe `eval()` in Llama3 tool-call parsing
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.23%). Schedule for your next planned update.
Does your project use an affected xinference version?
Paste your requirements.txt to check it for CVE-2026-61539 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Xinference used Python's unsafe eval() function when parsing Llama3 tool-call output generated by a large language model. Because the model output can be influenced by attacker-controlled prompts sent to the chat completion API, a remote attacker can craft prompts that cause the model to return a Python expression. Xinference then evaluates that expression on the server while post-processing the tool-call result. In the tested default deployment, authentication was not enabled, so the vulnerability was exploitable by an unauthenticated remote attacker through the /v1/chat/completions endpoint.
Details
Users can interact with deployed models through Xinference's OpenAI-compatible /v1/chat/completions API. The request entry point is implemented in xinference/api/restful_api.py; non-streaming requests call the model instance's chat() method and return the inference result.
When the Transformers backend is used, inference results flow through the batching logic in xinference/model/llm/transformers/core.py. Non-streaming chat results are handled by handle_chat_result_non_streaming(). If the request contains a tools field, Xinference calls _post_process_completion() to parse tool-call output from the model response.
The Llama3 tool-call parser is implemented in xinference/model/llm/tool_parsers/llama3_tool_parser.py. In affected versions, extract_tool_calls() parsed model output with eval():
def extract_tool_calls(
self, model_output: str
) -> List[Tuple[Optional[str], Optional[str], Optional[Dict[str, Any]]]]:
try:
data = eval(model_output, {}, {})
return [(None, data["name"], data["parameters"])]
except Exception:
return [(model_output, None, None)]
The intended behavior was to convert a Python dictionary-like string generated by the model into a dictionary object. However, eval() executes the input as a Python expression, and eval(model_output, {}, {}) is not a security sandbox. If an attacker can influence the model output through prompt injection or direct chat input, the attacker can cause the model to return an expression such as:
__import__('os').system('touch /tmp/hacked')
When the expression reaches eval(), it is executed in the Xinference server process context. The harmless touch /tmp/hacked command can be replaced with other payloads, such as a reverse shell, malware download, sensitive file read, or lateral-movement payload.
Score
Severity: Critical
CVSS v3.1: 10.0
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Rationale:
- AV:N: the vulnerable API is remotely reachable over the network;
- AC:L: exploitation only requires a crafted chat-completion request and tool-call parameter;
- PR:N: the tested default configuration did not require authentication;
- UI:N: no user interaction is required;
- S:C: command execution can affect resources beyond the Xinference application boundary;
- C:H/I:H/A:H: remote code execution can fully compromise confidentiality, integrity, and availability.
Credit
This vulnerability was discovered by:
- XlabAI Team of Tencent Xuanwu Lab (xlabai@tencent.com)
- Atuin Automated Vulnerability Discovery Engine
- Guannan Wang (wgnbuaa@gmail.com), Zhanpeng Liu (pkugenuine@gmail.com), Guancheng Li (lgcpku@gmail.com)
Advisory Timeline
- First published August 21, 2026 (97 days ago).
- Last revised September 10, 2026 — 20 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "xinference>=2.7.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| xinference PyPI · Affected: 0.0.0, 0.0.1, 0.0.2, 0.0.3 (+134 more) | 2.7.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-95
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
References
- https://github.com/xorbitsai/inference/security/advisories/GHSA-x2rj-828p-hx9mWEB
- https://github.com/xorbitsai/inference/pull/4786WEB
- https://github.com/xorbitsai/inference/commit/1b3d220f342ce68d34cec4586d9409d457dadc42WEB
- https://github.com/xorbitsai/inferencePACKAGE
- https://github.com/xorbitsai/inference/releases/tag/v2.7.0WEB
Frequently Asked Questions
- What is CVE-2026-61539?
- Xinference vulnerable to remote code execution via unsafe `eval()` in Llama3 tool-call parsing. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 10.0/10).
- How do I check if my project is affected by CVE-2026-61539?
- CVE-2026-61539 affects xinference. It has a 1.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-61539 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 68.7% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-77359CRITICAL
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
- CVE-2026-77312CRITICAL
Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)