CVE-2025-71353: Picklescan Deserialization Vulnerability Leads to Remote Code Execution
Picklescan before version 0.0.28 contains a deserialization vulnerability where it fails to properly detect malicious pickle files. Attackers can craft these files with embedded code that exploits the `torch._dynamo.guards.GuardBuilder.get` function in reduce methods, leading to arbitrary command execution when loaded on a victim system.
CVE-2025-71353 details a critical deserialization vulnerability affecting picklescan versions prior to 0.0.28. picklescan is a tool designed to identify and mitigate malicious Python pickle files. However, this vulnerability allows attackers to craft specially designed pickle files that leverage the torch._dynamo.guards.GuardBuilder.get function within Python's reduce methods. These crafted files contain embedded arbitrary commands that picklescan fails to detect. Consequently, if such a file is subsequently loaded by an application, the malicious code can execute on the victim's system, leading to remote code execution (RCE). This vulnerability poses a significant risk to systems that process untrusted pickle files, as the security scanner intended to protect them can be bypassed.
Attack Chain
- Attacker crafts malicious pickle file: An attacker generates a Python pickle file containing serialized data that, when deserialized, exploits the
torch._dynamo.guards.GuardBuilder.getfunction in itsreducemethods to embed arbitrary commands. - Distribution of malicious pickle file: The attacker distributes this malicious pickle file to a victim, potentially via email attachments, compromised package repositories, or direct downloads.
- Victim scans file with
picklescan: The victim system, or an application interacting with the file, usespicklescan(version prior to 0.0.28) to scan the received pickle file for malicious content. picklescanfails detection: Due to the flaw described in CVE-2025-71353,picklescanfails to identify the embedded malicious payload within the specially crafted pickle file, deeming it safe.- Malicious pickle file is loaded: An application on the victim's system, trusting the scan results or lacking further validation, proceeds to load and deserialize the now "clean" malicious pickle file.
- Arbitrary Command Execution: During the deserialization process, the embedded arbitrary commands are executed in the context of the vulnerable application, leading to remote code execution on the victim's system.
Impact
Successful exploitation of CVE-2025-71353 leads to remote code execution (RCE) on the compromised system. This grants attackers the ability to execute arbitrary commands, potentially leading to full system compromise, data theft, data alteration, or the deployment of further malware. The vulnerability has a CVSS v3.1 base score of 8.1 (High), reflecting high impacts on confidentiality and integrity, as attackers can bypass an intended security control to achieve their objectives. All applications and users relying on picklescan for validating Python pickle files are at risk if running affected versions.
Recommendation
- Upgrade
picklescanto version 0.0.28 or later immediately to remediate CVE-2025-71353. - Review and update any systems or applications that use
picklescanto scan incoming pickle files to ensure they are using the patched version. - Implement strong input validation and integrity checks for all deserialized data, especially from untrusted sources, even after scanning.
Indicators of compromise
2
url
| Type | Value |
|---|---|
| url | https://github.com/mmaitre314/picklescan/security/advisories/GHSA-86cj-95qr-2p4f |
| url | https://www.vulncheck.com/advisories/picklescan-remote-code-execution-via-torch-dynamo-guards-guardbuilder-get |