unsloth-zoo: Unsloth Zoo Code Injection via model_type in config.json
What fixes it
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Unsloth Zoo versions 2025.9.9 before 2026.8.14, as implemented in Unsloth 2025.9.9 through 2026.8.19, contains a code injection vulnerability in the model-loading compile path where the get_transformers_model_type() function in hf_utils.py collects model_type values from nested model configurations without enforcing a character allowlist, allowing newlines and arbitrary Python source to survive normalization. Attackers can embed a newline in a nested model_type value within a malicious model's config.json to terminate the generated import statement and execute arbitrary Python code via exec() in unsloth_compile_transformers(), achieving remote code execution as the loading user when the model is loaded for training or inference.
Text from CVE List
Affected versions 2
- unsloth-zooaffected: 2025.9.9 before 2026.8.14CVE List
- unslothaffected: 2025.9.9 before 2026.8.20CVE List
References 4
- github.com/unslothai/unsloth-zoo/pull/1083Fixvia CVE List
- github.com/unslothai/unsloth-zoo/pull/1108Fixvia CVE List
- github.com/unslothai/unsloth/commit/92ee0207a38ebc8af1a0e678aa92d7e7d901ea0dFixvia CVE List
- vulncheck.com/advisories/unsloth-zoo-code-injection-via-model-type-in-config-jsonAdvisoryvia CVE List