Xinference through 2.11.0 Remote Code Execution via Hardcoded trust_remote_code in Model Loaders
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-76841
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 16:37 UTC · Revision 1
Source evidence
Xinference through 2.11.0 Remote Code Execution via Hardcoded trust_remote_code in Model Loaders
core-osv · Original sourcePublished 24 Aug 2026, 13:11 UTC
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.
osv:CVE-2026-76841
Complete source record
{
"id": "25b3a97120774f10a995622111c2c77816c57de1785bf59cb262f6602c560ff2",
"url": "https://osv.dev/vulnerability/CVE-2026-76841",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Xinference through 2.11.0 Remote Code Execution via Hardcoded trust_remote_code in Model Loaders",
"summary": "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.",
"evidence": "osv:CVE-2026-76841",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2026-76841",
"aliases": [
"CVE-2026-76841"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/xorbitsai/inference",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "0a310a515ce401e38937a58b7210b1fa874ee156"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "2.12.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"introduced": "0"
},
{
"fixed": "2.12.0"
}
],
"source": "DESCRIPTION"
}
]
}
}
],
"versions": [
"v2.11.0",
"v2.10.0",
"v2.9.0",
"v2.8.0",
"v2.7.0",
"v2.5.0",
"v2.4.0",
"v2.3.0",
"v2.2.0",
"v2.1.0",
"v2.0.0",
"v1.17.0",
"v1.16.0",
"v1.15.0",
"v1.14.0",
"v1.13.0",
"v1.12.0",
"v1.11.0.post1",
"v1.11.0",
"v1.10.1",
"v1.10.0",
"v1.9.1",
"v1.9.0",
"v1.8.1.rc1",
"v1.8.1",
"v1.8.0",
"v1.7.1.post1",
"v1.7.1",
"v1.7.0.post1",
"v1.7.0",
"v1.6.1",
"v1.6.0.post1",
"v1.6.0",
"v1.5.1",
"v1.5.0.post1",
"v1.5.0",
"v1.4.1",
"v1.4.0",
"v1.3.1.post1",
"v1.3.1",
"v1.3.0.post2",
"v1.3.0.post1",
"v1.2.2",
"v1.2.1",
"v1.2.0",
"v1.1.1",
"v1.1.0",
"v1.0.1",
"v1.0.0",
"v0.16.3",
"v0.16.2",
"v0.16.1",
"v0.16.0",
"v0.15.4",
"v0.15.3",
"v0.15.2",
"v0.15.1",
"v0.15.0",
"v0.14.4.post1",
"v0.14.4",
"v0.14.3",
"v0.14.2",
"v0.14.1.post1",
"v0.14.1",
"v0.14.0.post1",
"v0.14.0",
"v0.13.3",
"v0.13.2",
"v0.13.1",
"v0.13.0",
"v0.12.3",
"v0.12.2.post1",
"v0.12.2",
"v0.12.1",
"v0.12.0",
"v0.11.3",
"v0.11.2.post1",
"v0.11.2",
"v0.11.1",
"v0.11.0",
"v0.10.3",
"v0.10.2.post1",
"v0.10.2",
"v0.10.1",
"v0.10.0",
"v0.9.4",
"v0.9.3",
"v0.9.2",
"v0.9.1",
"v0.9.0",
"v0.8.5",
"v0.8.4",
"v0.8.3.1",
"v0.8.3",
"v0.8.2",
"v0.8.1",
"v0.8.0",
"v0.7.5",
"v0.7.4.1",
"v0.7.4",
"v0.7.3.1",
"v0.7.3",
"v0.7.2",
"v0.7.1",
"v0.7.0",
"v0.6.5",
"v0.6.4",
"v0.6.3",
"v0.6.2",
"v0.6.1",
"v0.6.0",
"v0.5.6",
"v0.5.5",
"v0.5.4",
"v0.5.3",
"v0.5.2",
"v0.5.1",
"v0.5.0",
"v0.4.4",
"v0.4.3",
"v0.4.2",
"v0.4.1",
"v0.4.0",
"v0.3.0",
"v0.2.3",
"v0.2.2",
"v0.2.1",
"v0.2.0",
"v0.1.3",
"v0.1.2",
"v0.1.1",
"v0.1.0",
"v0.0.6",
"v0.0.5",
"v0.0.4",
"v0.0.3",
"v0.0.2",
"v0.0.1"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-76841.json"
}
}
],
"modified": "2026-10-28T02:30:21.090468200Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/76xxx/CVE-2026-76841.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-76841",
"https://www.vulncheck.com/advisories/xinference-through-remote-code-execution-via-hardcoded-trust-remote-code-in-model-loaders",
"https://github.com/xorbitsai/inference/issues/5023",
"https://github.com/xorbitsai/inference/pull/5027",
"https://github.com/xorbitsai/inference",
"https://pypi.org/project/xinference/",
"https://github.com/xorbitsai/inference/blob/v2.11.0/xinference/model/rerank/core.py"
],
"provider_metadata": {
"cwe_ids": [
"CWE-94"
],
"cna_assigner": "VulnCheck",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/76xxx/CVE-2026-76841.json"
}
},
"related_cves": [
{
"value": "CVE-2026-76841",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 487247,
"published_at": "2026-08-24T13:11:59.094+00:00"
}