fix(security): replace unsafe pickle.loads with SafeUnpickler for CVE-2026-3989 (#20904)
This commit is contained in:
@@ -2144,6 +2144,11 @@ class SafeUnpickler(pickle.Unpickler):
|
||||
)
|
||||
|
||||
|
||||
def safe_pickle_load(fp):
|
||||
"""Drop-in replacement for pickle.load() that blocks unsafe class loading."""
|
||||
return SafeUnpickler(fp).load()
|
||||
|
||||
|
||||
def debug_timing(func):
|
||||
# todo: replace with a more organized instrumentation
|
||||
def wrapper(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user