From bba1d3562e6f9f1256ec64048cc23001c0bb7516 Mon Sep 17 00:00:00 2001 From: comrumino Date: Fri, 23 Feb 2024 17:28:52 -0600 Subject: [PATCH] Fixed #551 by validating the server side is configured to allow pickle --- rpyc/core/netref.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpyc/core/netref.py b/rpyc/core/netref.py index a5e9a2eb..eed559d5 100644 --- a/rpyc/core/netref.py +++ b/rpyc/core/netref.py @@ -251,6 +251,9 @@ def method(self, start, stop, *args): def __array__(self): # Note that protocol=-1 will only work between python # interpreters of the same version. + if not object.__getattribute__(self,'____conn__')._config["allow_pickle"]: + # Security check that server side allows pickling per #551 + raise ValueError("pickling is disabled") return pickle.loads(syncreq(self, consts.HANDLE_PICKLE, -1)) __array__.__doc__ = doc return __array__