CVE-2026-7669: Code Injection in sgl-project SGLang
A vulnerability was detected in sgl-project SGLang up to 0.5.9. Impacted is the function get_tokenizer of the file python/sglang/srt/utils/hf_transformers_utils.py of the component HuggingFace Transformer Handler. The manipulation of the argument trust_remote_code with the input False as part of Boolean results in code injection. The attack can be executed remotely. A high complexity level is associated with this attack. The exploitability is considered difficult. In get_tokenizer(), when the caller passes trust_remote_code=False and HuggingFace transformers v5 returns a TokenizersBackend instance (the generic fallback for tokenizer classes not in the registry), SGLang silently re-invokes AutoTokenizer.from_pretrained with trust_remote_code=True, overriding the caller's explicit security setting. A model repository containing a malicious tokenizer.py referenced via auto_map in tokenizer_config.json will execute arbitrary Python in the SGLang process during this second call. No log line or warning is emitted. The override affects all current SGLang versions because transformers==5.3.0 is pinned in pyproject.toml. Both tokenizer_mode="auto" and tokenizer_mode="slow" are affected. The exploit is now public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
AI Analysis
Technical Summary
This vulnerability arises in the get_tokenizer function of sgl-project SGLang (up to version 0.5.9) within the file python/sglang/srt/utils/hf_transformers_utils.py. When a caller sets trust_remote_code=False to prevent execution of remote code, the function silently overrides this to True upon re-invoking AutoTokenizer.from_pretrained if HuggingFace transformers v5 returns a TokenizersBackend instance. This behavior enables a malicious model repository containing a crafted tokenizer.py referenced via auto_map in tokenizer_config.json to execute arbitrary Python code within the SGLang process. Both tokenizer_mode="auto" and "slow" are affected. The vulnerability is present in all current SGLang versions due to the pinned transformers==5.3.0 dependency. The exploit is public, but no official fix or patch has been released.
Potential Impact
Successful exploitation allows remote attackers to execute arbitrary Python code within the SGLang process by supplying a malicious tokenizer model repository. This could lead to unauthorized code execution with the privileges of the SGLang application. The attack complexity is high and exploitability is difficult. No user interaction is required, and no logs or warnings are generated during exploitation. The vulnerability affects all versions up to 0.5.9 due to the pinned transformers dependency. There is no indication of known exploits in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The vendor has not responded to disclosure and no official fix or patch is available. Until a patch is released, users should avoid using untrusted or remote tokenizer models with SGLang, especially when relying on the trust_remote_code setting. Monitoring for updates from the vendor or community is recommended to apply any forthcoming fixes.
CVE-2026-7669: Code Injection in sgl-project SGLang
Description
A vulnerability was detected in sgl-project SGLang up to 0.5.9. Impacted is the function get_tokenizer of the file python/sglang/srt/utils/hf_transformers_utils.py of the component HuggingFace Transformer Handler. The manipulation of the argument trust_remote_code with the input False as part of Boolean results in code injection. The attack can be executed remotely. A high complexity level is associated with this attack. The exploitability is considered difficult. In get_tokenizer(), when the caller passes trust_remote_code=False and HuggingFace transformers v5 returns a TokenizersBackend instance (the generic fallback for tokenizer classes not in the registry), SGLang silently re-invokes AutoTokenizer.from_pretrained with trust_remote_code=True, overriding the caller's explicit security setting. A model repository containing a malicious tokenizer.py referenced via auto_map in tokenizer_config.json will execute arbitrary Python in the SGLang process during this second call. No log line or warning is emitted. The override affects all current SGLang versions because transformers==5.3.0 is pinned in pyproject.toml. Both tokenizer_mode="auto" and tokenizer_mode="slow" are affected. The exploit is now public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
CVSS v4.0
Score 6.3medium
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability arises in the get_tokenizer function of sgl-project SGLang (up to version 0.5.9) within the file python/sglang/srt/utils/hf_transformers_utils.py. When a caller sets trust_remote_code=False to prevent execution of remote code, the function silently overrides this to True upon re-invoking AutoTokenizer.from_pretrained if HuggingFace transformers v5 returns a TokenizersBackend instance. This behavior enables a malicious model repository containing a crafted tokenizer.py referenced via auto_map in tokenizer_config.json to execute arbitrary Python code within the SGLang process. Both tokenizer_mode="auto" and "slow" are affected. The vulnerability is present in all current SGLang versions due to the pinned transformers==5.3.0 dependency. The exploit is public, but no official fix or patch has been released.
Potential Impact
Successful exploitation allows remote attackers to execute arbitrary Python code within the SGLang process by supplying a malicious tokenizer model repository. This could lead to unauthorized code execution with the privileges of the SGLang application. The attack complexity is high and exploitability is difficult. No user interaction is required, and no logs or warnings are generated during exploitation. The vulnerability affects all versions up to 0.5.9 due to the pinned transformers dependency. There is no indication of known exploits in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The vendor has not responded to disclosure and no official fix or patch is available. Until a patch is released, users should avoid using untrusted or remote tokenizer models with SGLang, especially when relying on the trust_remote_code setting. Monitoring for updates from the vendor or community is recommended to apply any forthcoming fixes.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulDB
- Date Reserved
- 2026-05-02T08:00:13.701Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69f6755ecbff5d8610320ee1
Added to database: 5/2/2026, 10:06:22 PM
Last enriched: 5/10/2026, 2:06:36 AM
Last updated: 6/16/2026, 9:00:06 PM
Views: 194
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.