Repository navigation
Conversation
rossant
requested changes
Nov 5, 2026
rossant
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tackling this too! As far as I remember, Phy doesn’t use object-dtype arrays, so explicitly rejecting them seems reasonable.
Could you document that restriction and add a test rejecting a harmless object array? The current malicious object-array test fails at NumPy reconstruction, before reaching the malicious element, so it shouldn’t imply that filtering inside object arrays is supported.
Please also check the supported save_pickle output formats, including compression, and narrow the compatibility claims accordingly.
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.
Stacked on #71.
load_pickleusedjoblib.load, which runs arbitrary code from an untrusted pickle. It now uses a restricted joblib unpickler that only allows numpy arrays/dtypes/scalars and a few builtin types; anything else raisespickle.UnpicklingError. Object-dtype arrays are covered too. Requiresjoblib>=1.6(pinned inrequirements.txtandenvironment.yml), which routes nested object-array unpickling throughfind_class.Behaviour changes:
load_pickleno longer loads arbitrary objects, compressed files or memory-mapped arrays.save_pickleis unchanged, so existing files written by it still load.Tests check that arrays and containers round-trip and that malicious payloads (bare, nested, hidden in an object array) are refused without executing.