Skip to main content
Vulnerability Database/CVE-2026-112051

CVE-2026-112051: Xinference Path Traversal Vulnerability

CVE-2026-112051 is a path traversal flaw in Xinference through version 4.0.1 that enables attackers to write and delete arbitrary JSON files on Windows systems. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112051 Overview

CVE-2026-112051 is a path traversal vulnerability [CWE-22] in Xinference through version 4.0.1 running on Windows. Unauthenticated attackers can write and delete arbitrary .json files by injecting backslash sequences into the model_name field. The flaw is reachable through the POST /v1/model_registrations/{model_type} endpoint used to register persisted custom models. Supplying a name such as ..\..\evil lets an attacker escape the intended model directory and overwrite any file writable by the Xinference process.

Critical Impact

Unauthenticated remote attackers can overwrite or delete arbitrary .json configuration and data files on Windows hosts running Xinference, enabling integrity compromise and potential service disruption.

Affected Products

  • Xinference (xorbitsai/inference) versions up to and including 4.0.1
  • Deployments running on Windows operating systems
  • Instances exposing the custom model registration API without network restrictions

Discovery Timeline

  • 2026-10-18 - CVE-2026-112051 published to the National Vulnerability Database
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-112051

Vulnerability Analysis

The vulnerability resides in the custom model registration workflow of Xinference. When a client submits a model registration request, the server uses the attacker-supplied model_name field as a filename under the model cache directory. The validation routine in xinference/model/utils.py rejected several special characters but did not reject the backslash (\) character, which Windows interprets as a path separator.

Attackers can register a persisted custom model with a name like ..\..\evil. The server then concatenates that name with the base directory and writes a .json file at the resulting path. The same code path is reused during model deletion, allowing arbitrary .json files to be removed.

Because the endpoint POST /v1/model_registrations/{model_type} requires no authentication by default, any party reaching the service over the network can exercise the flaw. Impact is limited to files writable by the Xinference process, but these commonly include application configuration, cached metadata, and other .json artifacts the service depends on.

Root Cause

The original regular expression ^[^+\/?%#&=\s]*$ validated against forward slashes and whitespace but omitted the backslash and the special directory names . and ... On Windows, backslashes act as path separators, so values such as ..\..\evil survived validation and traversed outside the model directory in the subsequent cache_manager.py write operation.

Attack Vector

Exploitation requires only network access to the Xinference HTTP API. An attacker sends a crafted POST request to /v1/model_registrations/{model_type} containing a JSON body where model_name includes backslash traversal sequences. The server persists the registration JSON at the attacker-chosen path, overwriting any existing file with the same name.

python
     if len(model_name) == 0:
         return False
 
-    # check if contains +/?%#&=\s
-    return re.match(r"^[^+\/?%#&=\s]*$", model_name) is not None
+    # The name is used as a file name under the model directory, so it must
+    # not contain a path separator (backslash on Windows) or be "." or "..".
+    if model_name in (".", ".."):
+        return False
+
+    # check if contains +\/?%#&=\s
+    return re.match(r"^[^+\\/?%#&=\s]*$", model_name) is not None
 
 
 def parse_uri(uri: str) -> Tuple[str, str]:

Source: GitHub Commit beddc97

Detection Methods for CVE-2026-112051

Indicators of Compromise

  • HTTP POST requests to /v1/model_registrations/ endpoints containing \, .., or URL-encoded %5C sequences in the model_name field.
  • Unexpected creation or modification of .json files outside the Xinference model cache directory on Windows hosts.
  • Deletion of configuration .json files correlated with model deregistration API calls.

Detection Strategies

  • Inspect reverse proxy and application logs for registration requests whose model_name deviates from alphanumeric naming conventions.
  • Monitor the Xinference process for file write operations to paths that resolve above the model base directory using Sysmon event ID 11.
  • Alert on any registration request originating from unauthenticated or unexpected source networks.

Monitoring Recommendations

  • Enable verbose request logging on the Xinference API gateway and forward logs to a centralized analytics platform for retention and search.
  • Baseline normal custom model registration activity so anomalous model_name payloads trigger alerts.
  • Track file integrity on directories writable by the Xinference service account and flag unexpected .json changes.

How to Mitigate CVE-2026-112051

Immediate Actions Required

  • Upgrade Xinference to a version containing commit beddc97 or later, which rejects backslashes and the . and .. names in model_name.
  • Restrict network exposure of the Xinference API to trusted clients using firewall rules or a reverse proxy with authentication.
  • Audit model registration logs for prior exploitation attempts and review the integrity of .json files in and around the Xinference working directory.

Patch Information

The maintainers addressed the issue in commit beddc97ac211f8414597fe8479493be0603f7c84, titled "fix(model): reject backslash, "." and ".." in custom model names (#5707)". The fix updates the validation regular expression in xinference/model/utils.py to deny backslashes and explicitly rejects the . and .. names. See the VulnCheck advisory and the upstream GitHub issue #5702 for additional context.

Workarounds

  • Place the Xinference API behind an authenticating reverse proxy and restrict access to vetted clients until patching is complete.
  • Add a WAF or proxy rule that rejects requests to /v1/model_registrations/ whose JSON body contains \, %5C, .., or path separator characters inside model_name.
  • Run the Xinference service on Linux or inside a container with a read-only filesystem outside the model directory to limit the blast radius of arbitrary writes.
bash
# Example nginx snippet to block traversal payloads in model_name
location /v1/model_registrations/ {
    if ($request_body ~* "\"model_name\"\s*:\s*\"[^\"]*(\\\\|%5C|\\.\\.)") {
        return 400;
    }
    proxy_pass http://xinference_backend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.