fix(server): fail closed on unregistered model IDs - #1696
Open
SashaMIT wants to merge 1 commit into
Open
Conversation
Request model/draft_model/adapters values were treated as Hub or local paths when absent from the alias maps, so a client could force arbitrary downloads. Accept only registered aliases and resolve the CLI adapter against the request model id.
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.
Summary
ModelProvider.loadtreated unknown requestmodel/draft_model/adaptersvalues as Hub or local paths (dict.get(key, key)), so a client could force arbitrarysnapshot_download/ path loads against a runningmlx_lm.server.--adapter-pathagainst the request model id (fixes the silent drop that open Fix mlx_lm.server --adapter-path silently ignored at startup #1249 also targets; this PR additionally rejects free-form adapter paths).Test plan
pytest tests/test_server.py::TestModelProviderFailClosed(4 passed)254d153Commit is SSH-signed.
Made with Cursor