Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Baseline the eight unsloth-zoo 2026.10.1 findings after review (#12884)
Daniel Han6c3d91534b5f
diff --git a/scripts/scan_packages.py b/scripts/scan_packages.pyindex 03bd4e9869c..b27c3dbd336 100644--- a/scripts/scan_packages.py+++ b/scripts/scan_packages.py@@ -2894,6 +2894,10 @@ def _write_baseline() -> None:"""Persist CRITICAL/HIGH findings as an allowlist for human triage. Pins are carried over from `source`, the baseline in effect for this run, so regenerating cannot silently widen a reviewed entry; reading them from `path` instead would drop every pin whenever the output goes somewhere new."""pinned = {k for k, v in _load_baseline(source or path).items() if v is not None}+ # A site (package, file, check) reviewed under a pin stays pinned when its matched code+ # changes: the new variant has a new evidence hash, so it is not in `pinned`, and writing+ # it unpinned would suppress that finding whatever the file contains.+ pinned_sites = {k[:3] for k in pinned}entries = []seen: set[tuple[str, str, str, str]] = set()for f in sorted(findings, key = lambda f: SEVERITY_ORDER.get(f.severity, 99)):@@ -2911,7 +2915,7 @@ def _write_baseline("evidence": f.evidence,"evidence_hash": _evidence_hash(f.evidence),}- if key in pinned and f.file_sha256:+ if (key in pinned or key[:3] in pinned_sites) and f.file_sha256:entry["file_sha256"] = f.file_sha256entries.append(entry)doc = {diff --git a/scripts/scan_packages_baseline.json b/scripts/scan_packages_baseline.jsonindex a7c2d5f0558..a84dd93a08a 100644--- a/scripts/scan_packages_baseline.json+++ b/scripts/scan_packages_baseline.json@@ -2349,6 +2349,78 @@"evidence": "Obfusc: L337: exec(compile(cached_bytes, cache_file, \"exec\"), module.__dict__)\nExec: L337: exec(compile(cached_bytes, cache_file, \"exec\"), module.__dict__)","evidence_hash": "ef22a4fe0d8ec7e2b0e4afc6e6a3d997cd94c981bf59790562217d4f9dd70732","file_sha256": "7e002df98366c2def647ce59234e271b59f092d2826b4b25a2642177bedc4b59"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/llama_cpp.py",+ "check": "Harvests environment variables/secrets AND makes network calls",+ "severity": "CRITICAL",+ "evidence": "Env: L1037: token = os.environ.get(\"GH_TOKEN\") or os.environ.get(\"GITHUB_TOKEN\") | L5499: env = dict(env) if env is not None else dict(os.environ) | L5586: env = dict(os.environ)\nNetwork: L1045: response = requests.get(url, timeout = timeout, headers = headers, stream = stream) | L4197: response = requests.get(\nL4198: LLAMA_CPP_CONVERT_FILE, timeout = (10, 120)\nL4199: ) | L7663: check = requests.get(llama_cpp_chat_file, timeout = 5)",+ "evidence_hash": "88c38db8f2b8b9d6512709dd7a6d7a9a7bf8a3c48007124ff3680da3a5331d1d",+ "file_sha256": "4ced11216f5256c4ef546275a09c587d014c63a6ad811b7753ca315e5202fb78"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/vision_utils.py",+ "check": "Harvests environment variables/secrets AND makes network calls",+ "severity": "CRITICAL",+ "evidence": "Env: L152: return os.environ.get(UNSLOTH_ALLOW_PRIVATE_URL_FETCH_VAR, \"0\") == \"1\"\nNetwork: L110: from urllib.request import url2pathname | L479: session = requests.Session()",+ "evidence_hash": "3bbd70075adbff1b2cb50de320002a0dce6324653a8727ec60c42e0943dccdac",+ "file_sha256": "efb922a0b258de79cfdc24c0860983964064fbd6ec3e711dd1a3a5a79f13afcf"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/vision_utils.py",+ "check": "Accesses cloud metadata/IMDS AND makes network calls",+ "severity": "CRITICAL",+ "evidence": "IMDS: L145: \"metadata.google.internal\", \"metadata.goog\", \"metadata\",\nNetwork: L110: from urllib.request import url2pathname | L479: session = requests.Session()",+ "evidence_hash": "972786b837f20621c6615cf1c38a0b84abe925d302d7317679bc0272643c0793",+ "file_sha256": "efb922a0b258de79cfdc24c0860983964064fbd6ec3e711dd1a3a5a79f13afcf"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/temporary_patches/gpt_oss.py",+ "check": "Downloads and executes remote code",+ "severity": "CRITICAL",+ "evidence": "L2518: return importlib.import_module(root + \".matmul_ogs\").matmul_ogs",+ "evidence_hash": "58aa76d0aa49c056cec5778ad7ae5940e26a36890d42ff2a2e4ebcee4f591937",+ "file_sha256": "8e1468d43e6482f430e84144a7d1008b82d6df8c9b1919859994f2d29d5e21f0"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/compiler.py",+ "check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",+ "severity": "HIGH",+ "evidence": "Obfusc: L1846: exec(compile(source, file_location, \"exec\"), new_module.__dict__) | L2099: _mod = __import__(model_location, fromlist=items) | L6808: f\" {chr(92)}{chr(92)} /| Num examples = {num_examples:,} | Num Epochs = {num_train_epochs:,} | Total steps = {max_steps:,}\\\\n\"\\\\\nL6809: f\"O^O/ {chr(92)}_/ {chr(92)} Batch size per device = {self._train_batch_size:,} | Gradient accumulation steps = {args.gradient_accumulation_steps}\\\\n\"\\\\\nL6810: f\"{chr(92)} / Data Parallel GPUs = {args.world_size} | Total batch size ({self._train_batch_size} x {args.gradient_accumulation_steps} x {args.world_size}) = {total_train_batch_size: sha256:b7ea9cdbe360ad323911014caf12a9d4ec87cb36195a511080e4e484c2fb80d2\nL6811: f' \"-____-\" Trainable parameters = {get_model_param_count(model, trainable_only=True):,} of {get_model_param_count(model):,} ({get_model_param_count(model, trainable_only=True)/get_model_p sha256:9e832c1e7b2815aa44dc42638d821cb9df22550db88d85bd4bfb29c13f984b53 | L6809: f\"O^O/ {chr(92)}_/ {chr(92)} Batch size per device = {self._train_batch_size:,} | Gradient accumulation steps = {args.gradient_accumulation_steps}\\\\n\"\\\\\nL6810: f\"{chr(92)} / Data Parallel GPUs = {args.world_size} | Total batch size ({self._train_batch_size} x {args.gradient_accumulation_steps} x {args.world_size}) = {total_train_batch_size: sha256:b7ea9cdbe360ad323911014caf12a9d4ec87cb36195a511080e4e484c2fb80d2\nL6811: f' \"-____-\" Trainable parameters = {get_model_param_count(model, trainable_only=True):,} of {get_model_param_count(model):,} ({get_model_param_count(model, trainable_only=True)/get_model_p sha256:9e832c1e7b2815aa44dc42638d821cb9df22550db88d85bd4bfb29c13f984b53 | L6808: f\" {chr(92)}{chr(92)} /| Num examples = {num_examples:,} | Num Epochs = {num_train_epochs:,} | Total steps = {max_steps:,}\\\\n\"\\\\\nL6809: f\"O^O/ {chr(92)}_/ {chr(92)} Batch size per device = {self._train_batch_size:,} | Gradient accumulation steps = {args.gradient_accumulation_steps}\\\\n\"\\\\\nL6810: f\"{chr(92)} / Data Parallel GPUs = {args.world_size} | Total batch size ({self._train_batch_size} x {args.gradient_accumulation_steps} x {args.world_size}) = {total_train_batch_size: sha256:b7ea9cdbe360ad323911014caf12a9d4ec87cb36195a511080e4e484c2fb80d2\nExec: L1846: exec(compile(source, file_location, \"exec\"), new_module.__dict__) | L2023: _modeling_file = eval(model_location) | L2755: f = eval(f\"{model_location}.{module}\") | L3103: exec(f\"def raise_{j}(*args, **kwargs): print('{function}')\", globals(), locals()) | L3104: try: exec(f\"EMPTY_LOGITS.{function} = raise_{j}\", globals(), locals()) | L4780: exec(f\"import {parent}\", locals(), globals()) | L4886: dir(eval(parent)), | L4892: exec(f\"{parent}.{child}.forward = forward\", globals(), locals()) | L4972: module = eval(f\"modeling_file.{module}\") | L4999: inner_class = eval(f\"modeling_file.{inner_class}\") | L5193: exec(f\"from timm.layers.norm_act import {norm}\") | L5201: forward = eval(norm).forward | L5207: exec(f\"timm.layers.norm_act.{norm}.forward = forward\") | L5224: exec(f\"from timm.models._efficientnet_blocks import {block}\") | L5232: forward = eval(block).forward | L5238: exec(f\"timm.models._efficientnet_blocks.{block}.forward = forward\") | L5482: exec(\nL5483: f\"{model_location}.torch.nn.{module}.forward = forward\",\nL5484: globals(),\nL5485: locals(),\nL5486: ) | L5488: exec(f\"{model_location}.nn.{module}.forward = forward\", globals(), locals()) | L5492: exec(\nL5493: f\"combined_module.torch.nn.{module}.forward = forward\",\nL5494: globals(),\nL5495: locals(),\nL5496: ) | L5498: exec(f\"combined_module.nn.{module}.forward = forward\", globals(), locals()) | L5575: source = eval(f\"{model_location}.torch\") | L5582: function = eval(f\"source.nn.{module}\") | L5776: exec(\"import transformers\", globals()) | L5793: exec(\nL5794: \"model_logger.addFilter(HideLoggingMessage('`use_cache`'))\", globals(), locals()\nL5795: ) | L5797: exec(\nL5798: \"model_logger.addFilter(HideLoggingMessage('compile_config'))\",\nL5799: globals(),\nL5800: locals(),\nL5801: ) | L6035: source = eval(f\"modeling_file.{module}\") | L6049: source = eval(f\"modeling_file.{module}\") | L6160: source = eval(f\"modeling_file.{module}\") | L6198: source = eval(f\"{model_location}.{module}\") | L6278: source = eval(f\"{model_location}.{module}\") | L6326: source = eval(f\"{model_location}.{module}\") | L6564: source = eval(f\"{model_location}.{module}\") | L6575: exec(\nL6576: f\"{model_location}.{module}._update_causal_mask = no_update_causal_mask\",\nL6577: globals(),\nL6578: ) | L6638: source = eval(f\"{model_location}.{module}\") | L6679: module_cls = eval(f\"{model_location}.{module}\") | L6716: module_cls = eval(f\"{model_location}.{module}\") | L6793: exec(\nL6794: \"from transformers.trainer import (\" + \", \".join(x for x in good_items) + \")\",\nL6795: globals(),\nL6796: ) | L6858: exec(inner_training_loop, globals()) | L6867: function = eval(f\"{model_location}.{module}\") | L6954: function = eval(f\"{model_location}.{module}\") | L7131: exec(\nL7132: f\"{model_location}.{module} = combined_module.{module}\",\nL7133: globals(),\nL7134: locals(),\nL7135: ) | L7145: check_dicts = dir(eval(f\"{model_location}\")) | L7147: item = eval(f\"{model_location}.{check}\") | L7158: exec(\nL7159: f\"{model_location}.{check}['{key}'] = combined_module.{replaced_class}\",\nL7160: globals(),\nL7161: locals(),\nL7162: )",+ "evidence_hash": "aaba0e6f7c289e2d6ee4ac8ff927d691a450fb3913a4245aa0fab585dd28d871",+ "file_sha256": "14134bb0f483515fa1a4d7ac1300fa0636214e265c0c4b1d622732d66552b9cf"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/vllm_utils.py",+ "check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",+ "severity": "HIGH",+ "evidence": "Obfusc: L4192: lora_types.append(getattr(__import__(module_path, fromlist = [class_name]), class_name))\nExec: L1317: cross_attn_layer = eval(f'vllm_internals.{name}') | L1357: layernorm = eval(vllm_name).state_dict()[\"weight\"] | L1725: parent = eval(f\"new_model.{parent_path}\") if parent_path else new_model | L1731: exec(f\"new_model.{layer_name_br} = layer\") | L1802: exec(f\"new_model.{layer_name_br}.weight = None\") | L1803: exec(f\"new_model.{layer_name_br}.weight = weight_param\") | L1805: exec(f\"new_model.{layer_name_br}.bias = None\") | L1806: exec(f\"new_model.{layer_name_br}.bias = bias\") | L1812: exec(f\"new_model.{layer_name} = layer\") | L1831: new_model.eval() | L3999: exec(f\"module.to({dtype})\") | L4022: exec(f\"module.to({dtype})\") | L4992: model.eval() | L5032: new_model.eval()",+ "evidence_hash": "4928e730b84a3fa71dcc50cfe185c77c2028be09ad908706710ab864786b4659",+ "file_sha256": "4386a3646ba1899b4691f6ce38851b5f0ddf5180ad0d2b87d8a5b4ea723b2aa7"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/mlx/loader.py",+ "check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",+ "severity": "HIGH",+ "evidence": "Obfusc: L5202: _mod = __import__(module_name, fromlist=[\"_\"])\nExec: L162: mx.eval(model.parameters()) | L196: mx.eval([v for k, v in tree_flatten(casted) if is_mlx_norm_parameter_path(k)]) | L1440: mx.eval(model.parameters()) | L1441: mx.eval(mx.distributed.all_sum(mx.array(1.0), stream=mx.cpu)) | L1508: mx.eval(model.parameters()) | L1511: mx.eval(mx.distributed.all_sum(mx.array(1.0), stream=mx.cpu)) | L2940: mx.eval(altup.correct(predictions, activated)) | L3412: model.eval() | L3489: mx.eval(baseline, perturbed) | L4850: model.eval() | L5607: mx.eval(model.parameters()) | L5723: mx.eval(module.weight) | L8326: mx.eval(model.parameters()) | L8343: mx.eval(target.parameters()) | L9342: lambda: mx.eval(model.parameters()), | L9406: lambda: mx.eval(model.parameters()), | L9569: mx.eval(model.parameters())",+ "evidence_hash": "d1c32d6d0a0f4625af70ef11ce765a893c07f48e54c21fb8ff5ef43381daf18e",+ "file_sha256": "3ead131fa2c6bb8076c993cbc9b5238fe1edec534760790aa39893f4346d6b13"+ },+ {+ "package": "unsloth-zoo",+ "file": "unsloth_zoo/temporary_patches/moe_utils.py",+ "check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",+ "severity": "HIGH",+ "evidence": "Obfusc: L337: exec(compile(cached_bytes, cache_file, \"exec\"), module.__dict__)\nExec: L337: exec(compile(cached_bytes, cache_file, \"exec\"), module.__dict__)",+ "evidence_hash": "ef22a4fe0d8ec7e2b0e4afc6e6a3d997cd94c981bf59790562217d4f9dd70732",+ "file_sha256": "3e23c92b0245342887763365acc9806b0edefdd9f7e29fbae7d9990875081792"}]}diff --git a/tests/security/test_scan_packages.py b/tests/security/test_scan_packages.pyindex 7a5e6658fcd..1cbb6f3ceb6 100644--- a/tests/security/test_scan_packages.py+++ b/tests/security/test_scan_packages.py@@ -564,6 +564,12 @@ def test_context_dependent_unsloth_zoo_findings_are_digest_pinned():"unsloth_zoo/temporary_patches/moe_utils.py","Advanced obfuscation (marshal/compile/zlib) + exec/eval",),+ # Pinned since 2026.9.x for the same reason as compiler.py: it imports modules by+ # name and execs, so the matched lines say nothing about the rest of the file.+ (+ "unsloth_zoo/mlx/loader.py",+ "Advanced obfuscation (marshal/compile/zlib) + exec/eval",+ ),}# The evidence hashes of the superseded compiler.py variants, which are already# in the baseline unpinned. These are frozen by construction: an evidence hash is@@ -579,6 +585,11 @@ def test_context_dependent_unsloth_zoo_findings_are_digest_pinned():"ec1875fd32d00fe885e566ebda75163e46e838ca31020abb57e0991892c2bdf7","d8dabff7099fd84e1276c932c7bb70ba273333e5708eb149fec6a6130856085d","610993c0b6f612bbbf2fa0b593591375e7b20cb5c9b516ea60b6c44a8b9430e9",+ # mlx/loader.py variants approved before its entries were pinned.+ "7b44760032c5df6d379ccfdd0bff3d23f857f64e08210fa0fba8d2881d457634",+ "99be0b8b885c428ef382cdf98fe5cc7691a3fe65fdf2ff2d1ebfb3a152711dc0",+ "511d74ad8e4d5a219b0485b23f295fb1b27ba49b734cbb664225f20a996f426d",+ "70a40c97be03c8b24e15abcd4911b42cd1b30bcb67cf345464c600d19aeb1f77",}pinned = set()for entry in entries:@@ -2056,6 +2067,30 @@ def test_write_baseline_preserves_an_existing_pin(tmp_path):assert doc2["entries"][0]["file_sha256"] == "a" * 64+def test_write_baseline_keeps_a_pinned_site_pinned_when_its_evidence_changes(tmp_path):+ """A release that edits the matched lines at a pinned site gives the finding a new+ evidence hash. The re-approval must still carry the file digest: unpinned, the new+ variant would suppress the finding for any file contents (#12884 wrote one)."""+ bl = tmp_path / "bl.json"+ old = _mk(sp.HIGH, "p", "a.py", "c1", "L1: x")+ old.file_sha256 = "a" * 64+ sp._write_baseline(str(bl), [old])+ doc = json.loads(bl.read_text(encoding = "utf-8"))+ doc["entries"][0]["file_sha256"] = "a" * 64+ bl.write_text(json.dumps(doc), encoding = "utf-8")++ changed = _mk(sp.HIGH, "p", "a.py", "c1", "L1: x | L2: y")+ changed.file_sha256 = "b" * 64+ fresh = _mk(sp.HIGH, "p", "b.py", "c1", "L1: x")+ fresh.file_sha256 = "c" * 64+ out = tmp_path / "out.json"+ sp._write_baseline(str(out), [changed, fresh], source = str(bl))+ by_file = {e["file"]: e for e in json.loads(out.read_text(encoding = "utf-8"))["entries"]}+ assert by_file["a.py"]["file_sha256"] == "b" * 64+ # A site never reviewed under a pin keeps the old default.+ assert "file_sha256" not in by_file["b.py"]++def test_check_py_file_stamps_the_file_digest():"""Findings carry the digest the pin is matched against."""src = 'import requests\nimport os\nt = os.environ["HF_TOKEN"]\nrequests.get("http://x", headers={"a": t})\n'