CVE-2026-76841: Improper Control of Generation of Code ('Code Injection') in xorbitsai inference
Description
Xinference loads models with Hugging Face remote code execution unconditionally enabled, and before version 2.12.0 exposes no setting to disable it. Six loader call sites pass trust_remote_code=True as a literal or as an unconditional default: RerankModel._get_tokenizer in xinference/model/rerank/core.py, SentenceTransformerRerankModel.load in xinference/model/rerank/sentence_transformers/core.py, SentenceTransformerEmbeddingModel.load in xinference/model/embedding/sentence_transformers/core.py, FlagEmbeddingModel.load in xinference/model/embedding/flag/core.py, and two sites in xinference/model/llm/transformers/core.py where PytorchModel._sanitize_model_config and PytorchModel._get_components default the value to True. Because a caller with model launch access can register a model whose type is unknown and supply an arbitrary model path, the server reaches _auto_detect_type and then AutoTokenizer.from_pretrained, which imports and executes Python declared by the model directory's own tokenizer_config.json auto_map, running attacker-supplied code with the privileges of the worker process. Version 2.12.0 gates every site behind allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting, permitting remote code only for bundled built-in models.
CVSS v4.0
Score 8.7high
Affected software
xorbitsai
inference
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Xinference versions before 2.12.0 load models using Hugging Face's AutoTokenizer.from_pretrained with the trust_remote_code parameter set to True unconditionally at six loader call sites. This means that when a model is loaded, Python code declared by the model's tokenizer_config.json auto_map is executed without restriction. An attacker who can register a model with an arbitrary path can trigger this code execution, running arbitrary code with the worker process's privileges. Version 2.12.0 mitigates this by gating all such calls behind allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting, allowing remote code execution only for bundled built-in models.
Potential Impact
An attacker with access to launch models on the server can execute arbitrary code remotely with the privileges of the worker process. This can lead to full compromise of the inference server, data theft, or further lateral movement within the environment. The vulnerability has a CVSS 4.0 score of 8.7 (high severity), reflecting the network attack vector, low complexity, no user interaction, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade xorbitsai inference to version 2.12.0 or later, which introduces configuration options to disable untrusted remote code execution. Specifically, version 2.12.0 gates all trust_remote_code calls behind allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting, permitting remote code execution only for bundled built-in models. Until upgraded, restrict model launch access to trusted users only to reduce risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-19T20:34:19.724Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8c45b3acd9273b49946345
Added to database: 08/24/2026, 13:22:59 UTC
Last enriched: 10/02/2026, 15:54:20 UTC
Last updated: 10/08/2026, 18:48:48 UTC
Views: 49
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.