Skip to content
Paramz Issues 60

Paramz Issues 60

github.com • November 26, 2026

paramz loads a saved model by reading the file with a stock pickle.load , so a crafted model file runs arbitrary code as the user while it is loaded. Loading a received or shared model (including through GPy.load , which delegates here) runs its author's code.

_unpickle runs a stock pickle.load ( __init__.py:47 , and :49 for the file-object path) with no trust check. The public loader is load ( __init__.py:52 ), paired with the documented m.pickle(path) save. A __reduce__ gadget in the file runs during the load.

Tested with paramz 0.10.0, Python 3 on Linux.

Build a malicious model file:

Victim action (the shipped public loader):

A legitimate model file deserializes to its parameter object and runs nothing; the gadget is the only difference.

paramz is the parameterization and serialization backend for GPy and related Gaussian-process libraries; models are saved with m.pickle('file.pickle') and loaded with paramz.load() or GPy.load() . Such model files are shared between collaborators and published with papers, so loading a received model runs the sender's code with the user's privileges.

Load through a restricted Unpickler whose find_class allow-lists only the expected paramz and numpy types, or move the saved format off pickle. The change is in _unpickle in paramz/__init__.py .

Package: paramz (PyPI)

Project:

Source:

Affected versions: <= 0.10.0 (through default-branch HEAD e9b1132c )

Patched versions: none

Severity: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Dilanka Kaushal Hewage (r3vpwnx) [email protected]

lawrennd added 2 commits that reference this issue on Nov 22, 2026 CIP-0005: Propose restricted unpickler for paramz.load (issue #60 ). 57d24fd CIP-0005: Accept restricted unpickler plan for issue #60 . ca7bf64

CIP-0005: Propose restricted unpickler for paramz.load (issue #60 ).

CIP-0005: Accept restricted unpickler plan for issue #60 .

lawrennd added a commit that references this issue on Nov 25, 2026 Merge pull request #61 from sods/cip0005-restricted-unpickler e9fb87f

Merge pull request #61 from sods/cip0005-restricted-unpickler

lawrennd closed this as completed in #61 on Nov 25, 2026

Extracted Entities