Studio: flag a modules.json folder of only dots and slashes that leaves the model by danielhanchen · Pull Request #14527 · unslothai/unsloth · GitHub
Skip to content

Studio: flag a modules.json folder of only dots and slashes that leaves the model - #14527

Open
danielhanchen wants to merge 1 commit into
mainfrom
studio-modules-json-dot-paths
Open

danielhanchen wants to merge 1 commit into
mainfrom
studio-modules-json-dot-paths

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #14428.

Problem. escaping_weight_references reads a Sentence Transformers folder's modules.json and flags module folders outside the model. Before the escape check it skipped paths that strip("./\\") empties, meant for the model root ("", ., ./). But .., ../.., / and \ are also only dots and slashes, so they were skipped too, and a managed account's model folder could name a module folder above it (its account root, or the Studio root) without the load, export or training gate noticing.

Change. The escape check now runs first; the self-folder skip comes after it. A module at the model root is still accepted, so ordinary Sentence Transformers folders load as before. Owner accounts are unaffected (the gate only runs for managed accounts), and notebook loading in unsloth is unchanged.

Testing.

  • test_account_path_confinement.py: 38 passed. The 6 new escape cases (.., ../.., /, \, ./.., ..\..) fail on main; the root cases ("", ., ./) pass on both.
  • Neighbouring suites (test_embedding_model_security_gate.py, test_export_decision_backend.py, test_decision_training_route.py, test_export_absolute_paths.py): 134 passed. One test_export_absolute_paths.py case fails the same way on main in this environment (core.inference.diffusion_lora not importable).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

@chatgpt-codex-connector

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant