CVE-2025-10155: PickleScan Security Bypass Using Misleading File Extension

Published Sep 10, 2025
·
Updated

Summary Picklescan can be bypassed, allowing the detection of malicious pickle files to fail, when a standard pickle file is given a PyTorch-related file extension (e.g., .bin). This occurs because the scanner prioritizes PyTorch file extension checks and errors out when parsing a standard pickle file with such an extension instead of falling back to standard pickle analysis. This vulnerability allows attackers to disguise malicious pickle payloads within files that would otherwise be scanned for pickle-based threats. Details The vulnerability stems from the logic in the scanbytes function within picklescan/scanner.py, specifically around line 463: https://github.com/mmaitre314/picklescan/blob/75e60f2c02f3f1a029362e6f334e1921392dcf60/src/picklescan/scanner.py#L463 The code first checks if the file extension (fileext) is in the pytorchfileextension list. If it is (e.g., .bin), the scanpytorch function is called. When a standard pickle file is encountered with a PyTorch extension, scanpytorch will likely fail. Critically, the code then returns an Error without attempting to analyze the file as a standard pickle using scanpicklebytes. This prevents the detection of malicious payloads within such files. PoC - Download a malicious pickle file with a standard .pkl extension: wget <https://huggingface.co/kzanki/regularmodel/resolve/main/model.pkl?download=true> -O model.pkl - Scan the file with Picklescan (correct detection): /home/davfr/Tests/HF/dangerousmodel/model.pkl: dangerous import 'builtins exec' FOUND ----------- SCAN SUMMARY ----------- Scanned files: 1 Infected files: 1 Dangerous globals: 1

- Rename the file to use a PyTorch-related extension (e.g., .bin): cp model.pkl model.bin - Scan the renamed file with Picklescan: !Screenshot 2025-06-29 at 9 38 13

Observed Result: Picklescan fails and reports an error related to PyTorch parsing but does not detect the malicious pickle content. Expected Result: Picklescan should recognize the file as a standard pickle format despite the .bin extension and scan it accordingly, identifying the malicious content. Impact Severity: High Affected Users: Any organization or individual relying on Picklescan to ensure the safety of PyTorch models or other files that might contain embedded pickle objects. This includes users downloading pre-trained models or receiving files that could potentially contain malicious code. Impact Details: Attackers can craft malicious pickle payloads and disguise them within files using common PyTorch extensions (like .bin, .pt, etc.). These files would then bypass PickleScan's detection mechanism, allowing the malicious code to execute when the file is loaded by a vulnerable application or user. Potential Exploits: This vulnerability significantly weakens the security provided by PickleScan. It opens the door to various supply chain attacks, where malicious actors could distribute backdoored models through platforms like Hugging Face, PyTorch Hub, or even through direct file sharing. Users trusting PickleScan would be unknowingly exposed to these threats. Recommendations The most effective solution is to modify the scanning logic to ensure that standard pickle scanning is attempted as a fallback mechanism when PyTorch scanning fails or is not applicable. A suggested approach is: Attempt PyTorch Scan: If the file extension matches a known PyTorch extension, attempt to scan it as a PyTorch object. Fallback to Pickle Scan: Regardless of the success or failure of the PyTorch scan (or if the extension is not a PyTorch extension), always attempt to scan the file as a standard pickle. This ensures that files with misleading extensions are still analyzed for potential pickle-based vulnerabilities. Suggested Patch

--- a/src/picklescan/scanner.py +++ b/src/picklescan/scanner.py @@ -462,19 +462,28 @@ def scanbytes(data: IO[bytes], fileid, fileext: Optional[str] = None) -> Scan if fileext is not None and fileext in pytorchfileextensions: try: return scanpytorch(data, fileid) except InvalidMagicError as e: - log.error(f"ERROR: Invalid magic number for file {e}") - return ScanResult([], scanerr=True) + log.warning(f"PyTorch scan failed for {fileid} with extension {fileext}: {e}") + # Don't return error here - continue to other scan methods elif fileext is not None and fileext in numpyfileextensions: - return scannumpy(data, fileid) - else: - iszip = zipfile.iszipfile(data) - data.seek(0) - if iszip: - return scanzipbytes(data, fileid) - elif is7zfile(data): - return scan7zbytes(data, fileid) - else: - return scanpicklebytes(data, fileid) + try: + return scannumpy(data, fileid) + except Exception as e: + log.warning(f"NumPy scan failed for {fileid}: {e}") + + # Always attempt additional format checks as fallback + data.seek(0) # Reset stream position + iszip = zipfile.iszipfile(data) + data.seek(0) + if iszip: + return scanzipbytes(data, fileid) + elif is7zfile(data): + return scan7zbytes(data, fileid) + else: + # FIX: Always attempt pickle scanning as fallback + # This prevents the vulnerability where pickle files with wrong extensions bypass detection + return scanpicklebytes(data, fileid)

Other sources

An Improper Input Validation vulnerability in the scanning logic of mmaitre314 picklescan versions up to and including 0.0.30 allows a remote attacker to bypass pickle files security checks by supplying a standard pickle file with a PyTorch-related file extension. When the pickle file incorrectly considered safe is loaded, it can lead to the execution of malicious code.

NVD

Affected Software

3 affected componentsFixes available
mmaitre314 picklescan<=0.0.30
pip/picklescan<=0.0.30
0.0.31
mmaitre314 picklescan<0.0.31

Event History

Sep 10, 2025
Advisory Published
via GitHub·07:51 PM
Data Sourced
via GitHub·07:51 PM
DescriptionSeverityWeaknessAffected Software
Sep 17, 2025
CVE Published
via MITRE·09:38 AM
Data Sourced
via MITRE·09:38 AM
DescriptionWeakness
Data Sourced
via NVD·10:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 AM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-10155?

CVE-2025-10155 is classified as a high severity vulnerability due to its potential to allow remote attackers to bypass security checks.

2

How do I fix CVE-2025-10155?

To mitigate CVE-2025-10155, upgrade MMAitre314 Picklescan to version 0.0.31 or later, which addresses the input validation issue.

3

What type of vulnerability is CVE-2025-10155?

CVE-2025-10155 is an Improper Input Validation vulnerability specific to the scanning logic of MMAitre314 Picklescan.

4

Which versions of software are affected by CVE-2025-10155?

CVE-2025-10155 affects MMAitre314 Picklescan versions up to and including 0.0.30.

5

How can an attacker exploit CVE-2025-10155?

An attacker can exploit CVE-2025-10155 by supplying a standard pickle file with a PyTorch-related file extension to bypass security checks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203