Skip to content

Commit

Permalink
Merge pull request numpy#12922 from adeak/docfix_load_pickle
Browse files Browse the repository at this point in the history
DOC: Add note about arbitrary code execution to numpy.load
  • Loading branch information
mattip authored Feb 3, 2019
2 parents 972e10a + 113b28a commit d727253
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions numpy/lib/npyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ def load(file, mmap_mode=None, allow_pickle=True, fix_imports=True,
"""
Load arrays or pickled objects from ``.npy``, ``.npz`` or pickled files.
.. warning:: Loading files that contain object arrays uses the ``pickle``
module, which is not secure against erroneous or maliciously
constructed data. Consider passing ``allow_pickle=False`` to
load data that is known not to contain object arrays for the
safer handling of untrusted sources.
Parameters
----------
file : file-like object, string, or pathlib.Path
Expand Down

0 comments on commit d727253

Please sign in to comment.