CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-61539

CVE-2026-61539: Remote Code Execution via Llama3 Tool Parser Eval Injection in Xinference

Alon Barad
Alon Barad
Software Engineer

Aug 22, 2026·6 min read·42 visits

Executive Summary (TL;DR)

Unsafe use of Python's eval() in Xinference's Llama3 tool parser enables unauthenticated remote code execution via prompt injection. Upgrading to version 2.7.0 mitigates this risk by replacing eval() with json.loads() and ast.literal_eval().

CVE-2026-61539 is a critical remote code execution vulnerability in Xinference, an inference API framework for open-source LLMs. In version 2.5.0 and earlier, model-generated outputs representing Llama3 tool calls are passed directly to Python's built-in eval() function inside the parser components. By manipulating conversational input or injecting instructions, an attacker can influence the LLM to output a Python expression containing malicious system commands, resulting in unauthenticated remote code execution on the host. This vulnerability has been resolved in Xinference version 2.7.0.

Vulnerability Overview

Xinference is an open-source inference API framework designed for serving Large Language Models (LLMs), speech models, and multimodal models. In deployments running Llama3 models with tool calling enabled, the framework is exposed to a critical security flaw. Specifically, the component parsing model outputs handles tool call data unsafely.

The attack surface is accessible via the standard chat completion endpoints. When client requests prompt the model to invoke tools, the application processes the generated assistant response to extract tool arguments. Because the framework does not sanitize the string generated by the LLM before interpreting it, this architectural pattern creates an indirect pathway for executing operating system commands.

The vulnerability is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code. This issue allows unauthenticated remote attackers who can influence the LLM's output—either via direct API access or downstream prompt injection—to achieve code execution within the security context of the Xinference server process.

Root Cause Analysis

The root cause of CVE-2026-61539 resides in the dynamic interpretation of structured text using Python's built-in eval() function. When processing Llama3 tool calls, Xinference attempts to parse the text representation of a Python dictionary returned by the model. The application invokes eval(model_output, {}, {}) with the intent of converting the string into a native dictionary object.

While the developers passed empty dictionaries as the globals and locals arguments to restrict execution, this implementation does not establish a secure sandbox in Python. Python's runtime environment allows standard object attributes to be traversed to retrieve the built-in namespace. For example, expressions can utilize property accessors on basic literal objects, such as ().__class__.__bases__[0].__subclasses__(), to locate and invoke dangerous classes like subprocess.Popen or direct file handles.

Since Large Language Models generate text based on input prompts, the string passed to eval() is not entirely under the developer's control. An attacker can craft conversational inputs that influence or override the system instructions of the model. By manipulating the LLM into generating a Python expression containing malicious system calls instead of a valid JSON dictionary, the attacker triggers immediate execution of that payload when the server evaluates the generated string.

Code Analysis

The vulnerable logic was present in two locations within the codebase: extract_tool_calls in xinference/model/llm/tool_parsers/llama3_tool_parser.py and _eval_llama3_chat_arguments in xinference/model/llm/utils.py. In both cases, the raw model output was evaluated directly using the native eval() sink.

Below is the vulnerable implementation in llama3_tool_parser.py:

# Vulnerable code pattern
def extract_tool_calls(self, model_output: str):
    try:
        # DANGEROUS: Executes arbitrary code contained within model_output
        data = eval(model_output, {}, {})
        return [(None, data["name"], data["parameters"])]
    except Exception:
        return [(model_output, None, None)]

The corresponding patch replaces the dynamic interpreter sink with a secure parsing sequence using json.loads as the primary mechanism, and falling back to ast.literal_eval for Python-specific dictionary literals.

# Patched code implementation
try:
    # Try JSON first (most common LLM output format)
    data = json.loads(model_output)
except (json.JSONDecodeError, TypeError):
    try:
        # Fall back to ast.literal_eval for Python literal formats
        # Unlike eval(), ast.literal_eval() only parses literal structures
        data = ast.literal_eval(model_output)
    except (ValueError, SyntaxError):
        return [(model_output, None, None)]

Using ast.literal_eval secures the application because the Abstract Syntax Tree parser processes only standard Python constants (such as strings, numbers, tuples, lists, dictionaries, booleans, and None). If the input contains a function call, class instantiation, or module import, the parser raises a ValueError immediately instead of compiling and executing the code.

Exploitation Methodology

Exploitation of this vulnerability requires the attacker to submit a request to the chat completion API that forces the LLM to output a malicious Python expression. The endpoint /v1/chat/completions must be configured to utilize tools, which registers the Llama3 tool parser as the active parser for the session.

The attacker constructs a system or user message using prompt injection techniques designed to bypass the model's instructions. The objective is to instruct the model to ignore its tool formatting constraints and output a specific Python command string. A conceptual payload instruction might command the model to generate a response like __import__('os').system('id') instead of the expected dictionary.

When the LLM yields the malicious response, the Xinference server intercepts the string and passes it directly to extract_tool_calls. The server then executes the string via eval(). Because the execution occurs under the permissions of the Xinference daemon, this leads to system command execution on the host container or server, facilitating unauthorized access or control.

Impact Assessment

The security impact of CVE-2026-61539 is categorized as critical, receiving a CVSS v3.1 base score of 10.0. The exploit allows unauthenticated network-based attackers to execute arbitrary system commands, compromising the confidentiality, integrity, and availability of the host operating system.

Because the scope is changed (S:C), an exploit not only compromises the logical environment of the Python application but also allows the attacker to execute commands in the underlying container or host operating system. This capability permits attackers to access sensitive data, including model weights, API keys for upstream services, and database credentials stored on the server.

Furthermore, if the Xinference container is deployed with high privileges or lacks proper network isolation, attackers can leverage the initial foothold to pivot into internal networks, escalate privileges on the host system, or disrupt inference services entirely.

Remediation and Defense

The primary mitigation for this vulnerability is upgrading the Xinference installation to version 2.7.0 or later. This release replaces the vulnerable dynamic evaluation patterns with a safe combination of json.loads and ast.literal_eval, neutralizing the execution path entirely.

If upgrading is not immediately possible, administrators can apply manual modifications to llama3_tool_parser.py and utils.py by replacing the eval() statements with the safe parsing implementation shown in the patch details. Additionally, organizations should implement defense-in-depth measures to limit the potential impact of similar flaws.

API endpoints should be shielded from the open internet using reverse proxies and robust access control policies such as API keys or JWT authentication. Finally, the Xinference service must run under a dedicated, unprivileged operating system user account, and the container should use a read-only root file system with minimal system binaries to limit the impact of arbitrary command execution.

Official Patches

xorbitsaiOfficial pull request to mitigate eval parsing in Llama3 tool parser
xorbitsaiCore fix commit replacing eval with json.loads and ast.literal_eval

Technical Appendix

CVSS Score
10.0/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Affected Systems

xorbitsai/inference (Xinference) API Service

Affected Versions Detail

Product
Affected Versions
Fixed Version
inference
xorbitsai
<= 2.5.02.7.0
AttributeDetail
CWE IDCWE-95
Attack VectorNetwork
CVSS Score10.0
ImpactArbitrary Code Execution
Exploit StatusProof-of-Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1203Exploitation for Client Execution
Execution
CWE-95
Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

The product receives input from an upstream component, but does not neutralize or incorrectly neutralizes code syntax elements before treating the input as an executable instruction, enabling an attacker to execute arbitrary code.

Known Exploits & Detection

GitHub Security AdvisoryDetails explaining prompt injection vector triggering python eval function execution.

Vulnerability Timeline

GitHub Security Advisory Published
2026-08-21
CVE-2026-61539 assigned and updated on NVD
2026-08-21

References & Sources

  • [1]GitHub Security Advisory GHSA-x2rj-828p-hx9m
  • [2]NVD CVE-2026-61539 Detail Entry
  • [3]CVE Org Record CVE-2026-61539
  • [4]Xinference v2.7.0 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•38 minutes ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
1 views•11 min read
•about 2 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 3 hours ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 4 hours ago•CVE-2026-126304
8.7

CVE-2026-126304: Symlink Path Traversal in NLTK YCOECorpusReader

CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.

Amit Schendel
Amit Schendel
6 views•9 min read
•about 5 hours ago•CVE-2026-128077
6.5

CVE-2026-128077: Authorization Bypass via Request Path Desynchronization in Nuxt and @nuxt/nitro-server

CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 6 hours ago•CVE-2026-128084
4.8

CVE-2026-128084: Integer Truncation and SQL Query Truncation in sqlite3-ruby

Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.

Alon Barad
Alon Barad
5 views•11 min read