CVE-2026-61539: Xinference remote code execution via unsafe eval in Llama3 tool-call parsing

CVE-2026-61539 · Severity: critical · CVSS 10 · Published 2026-08-21

Xinference is a distributed inference framework that provides an OpenAI-compatible API for serving large language models. A critical flaw in the Llama3 tool-call parser uses Python's unsafe `eval()` function to process model output, allowing an unauthenticated remote attacker to inject malicious Python expressions through prompt injection and achieve arbitrary code execution on the server. The default deployment configuration does not require authentication, making this vulnerability trivially exploitable over the network.

Technologies: xinference (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-61539 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-61539 being exploited in the wild.
How severe is CVE-2026-61539?
Critical severity, with a CVSS score of 10, published 21 August 2026.
Which products and versions are affected?
xinference (PyPI) <= 2.5.0, ECOSYSTEM:introduced=0,fixed=2.7.0.
Is there a fix for CVE-2026-61539?
Yes. xinference (PyPI): upgrade to 2.7.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-61539 attacked?
It is attacked over the network.
Am I affected by CVE-2026-61539?
Check whether you run xinference (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • xinference (PyPI): upgrade to 2.7.0 or later
    pip install "xinference>=2.7.0"

Technical details

Xinference's Llama3 tool-call parser in `xinference/model/llm/tool_parsers/llama3_tool_parser.py` implements `extract_tool_calls()` using `eval(model_output, {}, {})` to convert model-generated dictionary-like strings into Python objects. The function is called during post-processing of tool-call results in the `/v1/chat/completions` endpoint when a `tools` parameter is present. An attacker can craft prompts that cause the LLM to return arbitrary Python expressions (e.g., `__import__('os').system('command')`), which are then executed in the Xinference server process context. The vulnerability requires network access to the chat completion API and no authentication in default configurations. Attack preconditions are minimal: only a crafted chat request with a `tools` field is needed. Fix: upgrade to version 2.7.0 or later, which replaces `eval()` with a safe JSON parser.

Affected products

  • Xorbits AI Xinference <= 2.5.0

Identifiers

  • CVE-2026-61539
  • GHSA-x2rj-828p-hx9m
  • PYSEC-2026-3946

Timeline

  • 2026-07-13: disclosed: Initially published in GitHub Advisory Database
  • 2026-08-21: advisory: Updated with final severity and CVE assignment
  • 2026-07-13: patched: Fix released in version 2.7.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.