Summary
CVE-2026-61539 is a critical eval-injection vulnerability (CWE-95) in Xinference, an open-source OpenAI-compatible inference server (xorbitsai/inference) used to serve open-source LLM, speech, and multimodal models. Versions 2.5.0 and earlier pass attacker-influenced Llama3 tool-call output directly into Python’s eval(), allowing an unauthenticated remote attacker to achieve arbitrary code execution on the server host via a crafted chat completion request. The flaw carries the maximum CVSS v3.1 base score of 10.0 (Critical).
Technical details
- Root cause: The Llama3 tool-call parser (
xinference/model/llm/tool_parsers/llama3_tool_parser.py) and a related helper inxinference/model/llm/utils.pyevaluate model-generated text as Python code usingeval(model_output, {}, {}). Restricting the globals/locals namespace does not preventeval()from executing arbitrary Python expressions, so this is not an effective sandbox. - Trigger conditions: A request to the
/v1/chat/completionsOpenAI-compatible endpoint that includes atoolsfield. The request flows throughxinference/api/restful_api.pyandxinference/model/llm/transformers/core.py, intohandle_chat_result_non_streaming()and_post_process_completion(), which callextract_tool_calls()or_eval_llama3_chat_arguments()— the functions that ultimately invokeeval()on model output. - Attack vector: Network, no authentication or user interaction required. An attacker crafts a prompt that manipulates the model into generating a malicious "tool call" argument string; when the server evaluates that string as Python, attacker-controlled code executes.
- Impact: Full compromise of confidentiality, integrity, and availability — arbitrary command/code execution in the context of the Xinference server process, enabling data theft, model/data tampering, lateral movement, or denial of service.
Affected software
- Vendor/Product: xorbitsai / inference (Xinference)
- Affected versions: All versions up to and including 2.5.0 (versions prior to 2.7.0 that contain the vulnerable
eval()code path) - Fixed version: 2.7.0
Severity
- CVSS v3.1 Base Score: 10.0 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade Xinference to version 2.7.0 or later, which removes the unsafe
eval()-based tool-call parsing. - If immediate patching is not possible:
- Restrict network exposure of the Xinference
/v1/chat/completionsAPI — do not expose it directly to the internet; place it behind authentication, an API gateway, or a network allow-list. - Disable or avoid using Llama3-based tool-calling functionality until patched.
- Monitor Xinference server logs and host activity for anomalous process execution originating from the inference service.
- Run the Xinference service with least-privilege OS permissions and in an isolated/sandboxed environment (e.g., container with restricted capabilities) to limit blast radius if exploited.
- Restrict network exposure of the Xinference

