CVE-2026-76841: Improper Control of Generation of Code ('Code Injection') in xorbitsai inference
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.
AI Analysis
Technical Summary
Xinference loads models using Hugging Face's AutoTokenizer.from_pretrained with trust_remote_code=True unconditionally in multiple loader call sites before version 2.12.0. This enables an attacker who can register a model to supply a malicious model directory containing a tokenizer_config.json with an auto_map that imports and executes arbitrary Python code. Because the code runs with the privileges of the worker process, this constitutes a code injection vulnerability. Version 2.12.0 introduces controls to restrict remote code execution to only bundled built-in models via allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting.
Potential Impact
An attacker with the ability to register a model can execute arbitrary code on the server with the privileges of the worker process. This can lead to full compromise of the inference service environment. The vulnerability affects all versions prior to 2.12.0 and allows remote code execution without user interaction or elevated privileges beyond model launch access.
Mitigation Recommendations
Upgrade to version 2.12.0 or later, which introduces allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting to restrict remote code execution to trusted built-in models only. Prior to upgrading, restrict model registration permissions to trusted users only to reduce risk. Patch status is not explicitly confirmed beyond the mention of version 2.12.0 gating the feature; check the vendor advisory for the latest remediation guidance.
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
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 loads models using Hugging Face's AutoTokenizer.from_pretrained with trust_remote_code=True unconditionally in multiple loader call sites before version 2.12.0. This enables an attacker who can register a model to supply a malicious model directory containing a tokenizer_config.json with an auto_map that imports and executes arbitrary Python code. Because the code runs with the privileges of the worker process, this constitutes a code injection vulnerability. Version 2.12.0 introduces controls to restrict remote code execution to only bundled built-in models via allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting.
Potential Impact
An attacker with the ability to register a model can execute arbitrary code on the server with the privileges of the worker process. This can lead to full compromise of the inference service environment. The vulnerability affects all versions prior to 2.12.0 and allows remote code execution without user interaction or elevated privileges beyond model launch access.
Mitigation Recommendations
Upgrade to version 2.12.0 or later, which introduces allow_trust_remote_code and the XINFERENCE_TRUST_REMOTE_CODE setting to restrict remote code execution to trusted built-in models only. Prior to upgrading, restrict model registration permissions to trusted users only to reduce risk. Patch status is not explicitly confirmed beyond the mention of version 2.12.0 gating the feature; check the vendor advisory for the latest remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-19T20:34:19.724Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a8c45b3acd9273b49946345
Added to database: 08/24/2026, 13:22:59 UTC
Last enriched: 08/24/2026, 13:37:45 UTC
Last updated: 08/25/2026, 03:26:38 UTC
Views: 8
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.