{{ message }}
Repository navigation
Studio: flag a modules.json folder of only dots and slashes that leaves the model - #14527
Open
danielhanchen wants to merge 1 commit into
Open
danielhanchen wants to merge 1 commit into
danielhanchen wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #14428.
Problem.
escaping_weight_referencesreads a Sentence Transformers folder'smodules.jsonand flags module folders outside the model. Before the escape check it skipped paths thatstrip("./\\")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
unslothis unchanged.Testing.
test_account_path_confinement.py: 38 passed. The 6 new escape cases (..,../..,/,\,./..,..\..) fail on main; the root cases ("",.,./) pass on both.test_embedding_model_security_gate.py,test_export_decision_backend.py,test_decision_training_route.py,test_export_absolute_paths.py): 134 passed. Onetest_export_absolute_paths.pycase fails the same way on main in this environment (core.inference.diffusion_loranot importable).