The vulnerability lies in picklescan's failure to detect the use of the pty.spawn function, which can be used to execute arbitrary commands. The root cause is an incomplete blocklist of dangerous modules. The patch 70c1c6c31beb6baaf52c8db1b6c3c0e84a6f9dab addresses this by adding the pty module to the _unsafe_globals dictionary in src/picklescan/scanner.py. The function _build_scan_result_from_raw_globals is the core component that utilizes this blocklist to analyze the globals found in a pickle file. Prior to the patch, this function would not flag pty as dangerous due to its absence from the _unsafe_globals list. Therefore, _build_scan_result_from_raw_globals is the function where the vulnerability manifests, as it's responsible for the inadequate security check. The patch also includes a fix to the submodule checking logic within the same function, further highlighting its role in the vulnerability.
_build_scan_result_from_raw_globalssrc/picklescan/scanner.py
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| picklescan | pip | < 0.0.33 | 0.0.33 |
A Semantic Attack on Google Gemini - Read the Latest Research