From 88f6003a90b38704fdb29a4c440fed12545e3d00 Mon Sep 17 00:00:00 2001 From: tomaioo Date: Tue, 26 May 2026 11:36:23 -0700 Subject: [PATCH] fix(security): unsafe np.load with allow_pickle=true in npzfile The NPZFile class uses np.load with allow_pickle=True, which can execute arbitrary code when loading maliciously crafted NPZ files. This is a known security vulnerability in NumPy's loading mechanism that allows for remote code execution through pickled objects. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com> --- pynapple/io/interface_npz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynapple/io/interface_npz.py b/pynapple/io/interface_npz.py index 4f9e7ca6b..7c0ef7ffe 100644 --- a/pynapple/io/interface_npz.py +++ b/pynapple/io/interface_npz.py @@ -62,7 +62,7 @@ def __init__(self, path): path = Path(path) self.path = path self.name = path.name - self.file = np.load(self.path, allow_pickle=True) + self.file = np.load(self.path, allow_pickle=False) type_ = "" # First check if type is explicitely defined in the file: