MAINT: compensate for NumPy load change#2257
Merged
richardjgowers merged 1 commit intoMDAnalysis:developfrom Apr 29, 2019
Merged
MAINT: compensate for NumPy load change#2257richardjgowers merged 1 commit intoMDAnalysis:developfrom
richardjgowers merged 1 commit intoMDAnalysis:developfrom
Conversation
* upstream changes to np.load now require us to specify allow_pickle=True in encore machinery
Codecov Report
@@ Coverage Diff @@
## develop #2257 +/- ##
===========================================
+ Coverage 89.3% 89.66% +0.35%
===========================================
Files 156 172 +16
Lines 19407 21396 +1989
Branches 2783 2783
===========================================
+ Hits 17332 19184 +1852
- Misses 1473 1616 +143
+ Partials 602 596 -6
Continue to review full report at Codecov.
|
Member
Author
|
Lots of strange issues on Travis |
richardjgowers
approved these changes
Apr 29, 2019
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.
Fixes recent CI failures -- see for example #1991.
Related to: numpy/numpy#12889
And CVE: https://nvd.nist.gov/vuln/detail/CVE-2019-6446
Basically, someone decided it would be a good idea to open a government / software vulnerability ticket because
np.load()hadallow_pickle=Trueas the default, which theoretically might be exploited to execute arbitrary code.MDAnalysishas a usage ofnp.load()in the encore machinery that was depending on the original default, which has now been switched to comply with the CVE (otherwise, various corporations / government orgs can't use latest NumPy with an outsanding CVE).My fix here is the simplest one possible. Of course, one might argue that someone could just open a CVE about MDAnalysis now, but seriously maybe we can just patch to restore the original behavior and move on?
If we really want to be more secure, I suspect we may need a new kwarg somewhere in the encore machinery, which we might use in our testing, but not make the default to users.
So, maybe using
loadz(self, fname, allow_pickle=False):as a new signature, withTrueused in our testing. I suppose that may be a little more secure, but haven't tested this locally yet to see the implications.