Summary
Xinference exposes an unauthenticated model auto-registration endpoint that accepts a caller-controlled filesystem path. The service may read and return selected configuration files from that path, allowing an unauthenticated attacker to discover filesystem content and extract sensitive data when reachable files use the expected names.
Affected context
The vulnerability occurs in Xinference's POST /v1/models/llm/auto-register endpoint when it is accessible without authentication and accepts a model_path value without restricting it to an approved model directory. The endpoint attempts to read files such as config.json, tokenizer_config.json, and chat_template.jinja, then reflects parsed content to the requester. Exposure depends on network reachability, filesystem permissions, and the presence of readable files with those names.
Exploit preconditions
- Attack surface: The HTTP
POST /v1/models/llm/auto-registerendpoint - Required access: Network access to the endpoint; authentication is not required by the affected behavior
- Trigger point: Processing a caller-supplied
model_pathduring model auto-registration - Why exploitation is possible: The supplied path is not sufficiently confined to an approved directory, and selected files are read and returned based on that path
Why this happens
The underlying flaw is external control over a filesystem pathname without adequate validation, canonicalization, or directory confinement. The endpoint treats attacker-influenced path data as a trusted model location and performs file reads before establishing that the location belongs to an authorized model repository. This behavior maps to CWE-73: External Control of File Name or Path, because untrusted input influences which filesystem resources the application accesses.
Potential impact
- An attacker may read sensitive model or application configuration content
- The service could disclose filesystem structure and deployment details
- Credentials, tokens, or internal endpoints could be exposed if present in readable matching files
- Repeated probing may support broader reconnaissance of the hosting environment
General mitigation guidance
Mitigation generally focuses on removing unauthenticated access where it is not required and reducing trust in caller-supplied paths.
Common defensive patterns include:
- Restricting model paths to configured, approved directories
- Canonicalizing paths and rejecting values that resolve outside permitted roots
- Using allowlisted model identifiers rather than accepting arbitrary filesystem paths
- Enforcing authentication and authorization before model registration
- Limiting the service account's filesystem permissions and isolating model data
- Returning only the minimum metadata required for the operation
- Applying secure-by-default network policies that limit endpoint exposure
How teams detect issues like this
Organizations can identify this class of issue through:
- Static analysis rules for filesystem APIs receiving request parameters
- Code review checks for missing path canonicalization, root confinement, or allowlists
- API policy checks for sensitive endpoints that lack authentication or authorization
- Runtime monitoring of unusual model-path values and repeated registration requests
- File access auditing for unexpected reads of configuration files outside approved model directories
Automated security review tools may help flag externally controlled path arguments and unauthenticated file-access workflows.

