Harden privacy-filter remote-code allowlist for 1.5.2#59
Merged
Conversation
maziyarpanahi
added a commit
that referenced
this pull request
May 27, 2026
Harden privacy-filter remote-code allowlist for 1.5.2
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
This PR prepares the
1.5.2security release branch after the merged MLX converter fix in #58.It hardens the privacy-filter loading path so attacker-controlled Hugging Face repository names that merely contain
privacy-filterno longer route through a loader path that can enabletrust_remote_code=True.What Changed
openai/privacy-filterOpenMed/privacy-filter-multilingualOpenMed/privacy-filter-nemotronPrivacyFilterTorchPipelinesotrust_remote_codedefaults toFalse.create_privacy_filter_pipeline()to opt in totrust_remote_code=Trueonly after resolving the actual fallback model and checking the allowlist.attacker/foo-privacy-filter-barno longer route through the privacy-filter dispatcher.OPENMED_TRUSTED_REMOTE_CODE_MODELSas an operator escape hatch for controlled/private fine-tunes.1.5.2.CHANGELOG.mdfor the full1.5.2release, including the previously merged fix: add MLX weight remapping for openai_privacy_filter / nemotron architecture #58 MLX conversion fix.Root Cause
The privacy-filter dispatcher previously identified privacy-filter models with a substring match. That meant any model name containing
privacy-filtercould reach the privacy-filter-specific path. The PyTorch privacy-filter wrapper also defaultedtrust_remote_code=True, which is required for first-party OpenAI/OpenMed privacy-filter repos but unsafe for arbitrary repositories.This PR separates two concerns:
trust_remote_code=True.Release Notes
1.5.2now includes both:Validation
python -m pytest1194 passed, 1 skipped, 15 warningspython scripts/release/check_repo_policy.pyThe warnings are existing deprecation/span-validation warnings and are not introduced by this change.