CVE-2025-10156: Picklescan ZIP Archive Scan Bypass Is Vulnerability

CRITICAL
Advisory Identifier: GHSA-mjqp-26hc-grxg
CVSS 7.5
CWE-755 CWE-693
Published
Advisory Summary

CVE-2025-10156 is a CRITICAL (CVSS 7.5) zip archive scan bypass is vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Picklescan libraries in the PyPI ecosystem. The issue involves zip archive scan bypass is possible through non-exhaustive cyclic redundancy check. Remediation is available by upgrading affected packages to version 0.0.31.

CVE-2025-10156 at a Glance

CVE Identifier CVE-2025-10156
GHSA Identifier GHSA-mjqp-26hc-grxg
Severity CRITICAL
CVSS v3.1 Base Score 7.5
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Picklescan
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-10156

To remediate this vulnerability, upgrade all affected Picklescan dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

picklescan fixed: 0.0.31
pip install picklescan>=0.0.31
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show picklescan

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-10156, inspect your installed packages using pip:

pip show picklescan

Analyze the terminal output to locate any version of Picklescan in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.31), your application is affected.

Note: The pip show picklescan command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Picklescan, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Picklescan's ability to scan ZIP archives for malicious pickle files is compromised when the archive contains a file with a bad Cyclic Redundancy Check (CRC). Instead of attempting to scan the files within the archive, whatever the CRC is, Picklescan fails in error and returns no results. This allows attackers to potentially hide malicious pickle payloads within ZIP archives that PyTorch might still be able to load (as PyTorch often disables CRC checks). ### Details Picklescan likely utilizes Python's built-in zipfile module to handle ZIP archives. When zipfile encounters a file within an archive that has a mismatch between the declared CRC and the calculated CRC, it can raise an exception (e.g., BadZipFile or a related error). It appears that Picklescan does not try to scan the files whatever the CRC is. This behavior contrasts with PyTorch's model loading capabilities, which in many cases might bypass CRC checks for ZIP archives - whatever the configuration is. This discrepancy creates a blind spot where a malicious model packaged in a ZIP with a bad CRC could be loaded by PyTorch while being completely missed by Picklescan. ### PoC 1. Download an existing Pytorch model with a bad CRC `wget <https://huggingface.co/jinaai/jina-embeddings-v2-base-en/resolve/main/pytorch_model.bin?download=true> -O pytorch_model.bin` 2. Attempt to scan the corrupted ZIP file with PickleScan: ``` # Assuming you have Picklescan installed and in your PATH picklescan -p pytorch_model.bin ``` ![Screenshot 2025-06-29 at 13 52 07](https://github.com/user-attachments/assets/b7d7aca2-b7cd-4e7d-92f8-32ca4c42a000) **Observed Result**: Picklescan returns no results and presents an error message indicating a problem with the ZIP file, but it doesn’t attempt to scan any potentially valid pickle files within the archive. **Expected Result:** Picklescan should either: - Attempt to extract and scan other valid files within the ZIP archive, even if some have CRC errors. - Report a warning indicating that the ZIP archive has CRC errors and might be incomplete or corrupted, but still attempt to scan any accessible content. ### Impact **Severity**: High **Affected Users**: Any organization or individual using Picklescan to analyze PyTorch models or other files distributed as ZIP archives for malicious pickle content. **Impact Details**: Attackers can craft malicious PyTorch models containing embedded pickle payloads, package them into ZIP archives, and intentionally introduce CRC errors. This would cause Picklescan to fail to analyze the archive, while PyTorch is still able to load the model (depending on its configuration regarding CRC checks). This creates a significant vulnerability where malicious code can be distributed and potentially executed without detection by Picklescan. **Ex: Picklescan on HuggingFace goes into error** (https://huggingface.co/jinaai/jina-embeddings-v2-base-en/tree/main) ![Screenshot 2025-06-29 at 13 55 58](https://github.com/user-attachments/assets/1da2d2ce-ad3e-4bf1-addc-d8a18db5eac9) **Recommendations:** Picklescan should not fail on Bad CRC check, especially if Pytorch is not checking CRC. Relaxed Zipfile is perfect to fix this issue: ``` --- picklescan/src/picklescan/relaxed_zipfile.py +++ picklescan/src/picklescan/relaxed_zipfile.py @@ class RelaxedZipFile(zipfile.ZipFile): try: # Skip the file header: fheader = zef_file.read(sizeFileHeader) if len(fheader) != sizeFileHeader: raise zipfile.BadZipFile("Truncated file header") fheader = struct.unpack(structFileHeader, fheader) if fheader[_FH_SIGNATURE] != stringFileHeader: raise zipfile.BadZipFile("Bad magic number for file header") zef_file.read(fheader[_FH_FILENAME_LENGTH]) if fheader[_FH_EXTRA_FIELD_LENGTH]: zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH]) - return zipfile.ZipExtFile(zef_file, mode, zinfo, pwd, True) + + # Create the ZipExtFile and disable CRC check + ext_file = zipfile.ZipExtFile(zef_file, mode, zinfo, pwd) + # Monkey-patch to skip CRC validation + ext_file._expected_crc = None + return ext_file except BaseException: zef_file.close() raise ```

CVE-2025-10156 Affected Picklescan Versions

1 component(s)
Fixed Versions:
0.0.31
Product / Package Ecosystem Affected Versions Fixed Version
picklescan
PyPI
< 0.0.31
0.0.31

References

Frequently Asked Questions

What is CVE-2025-10156?
CVE-2025-10156 is a security vulnerability in Picklescan involving ZIP archive scan bypass is possible through non-exhaustive Cyclic Redundancy Check under CWE-755: Improper Handling of Exceptional Conditions.
Which Picklescan versions are affected?
Affected versions include releases prior to 0.0.31 across affected packages: picklescan.
What version fixes CVE-2025-10156?
Upgrading to 0.0.31 (or the latest patched release for your respective branch) resolves the vulnerability.
Is picklescan affected?
Yes, picklescan is affected in releases prior to 0.0.31. Upgrade your dependency to 0.0.31 or later.
What is the CVSS score of CVE-2025-10156?
CVE-2025-10156 has a CVSS v3.1 base score of 7.5 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-10156?
CVE-2025-10156 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check PyPI dependencies for CVE-2025-10156?
Run the dependency tree command: 'pip show picklescan'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mjqp-26hc-grxg",
  "modified" : "2026-06-06T14:43:36Z",
  "published" : "2025-09-10T19:50:46Z",
  "aliases" : [ "CVE-2025-10156" ],
  "summary" : "Picklescan: ZIP archive scan bypass is possible through non-exhaustive Cyclic Redundancy Check",
  "details" : "### Summary\nPicklescan's ability to scan ZIP archives for malicious pickle files is compromised when the archive contains a file with a bad Cyclic Redundancy Check (CRC). Instead of attempting to scan the files within the archive, whatever the CRC is, Picklescan fails in error and returns no results. This allows attackers to potentially hide malicious pickle payloads within ZIP archives that PyTorch might still be able to load (as PyTorch often disables CRC checks).\n\n\n### Details\nPicklescan likely utilizes Python's built-in zipfile module to handle ZIP archives. When zipfile encounters a file within an archive that has a mismatch between the declared CRC and the calculated CRC, it can raise an exception (e.g., BadZipFile or a related error). It appears that Picklescan does not try to scan the files whatever the CRC is.\nThis behavior contrasts with PyTorch's model loading capabilities, which in many cases might bypass CRC checks for ZIP archives - whatever the configuration is. This discrepancy creates a blind spot where a malicious model packaged in a ZIP with a bad CRC could be loaded by PyTorch while being completely missed by Picklescan.\n\n### PoC\n\n1. Download an existing Pytorch model with a bad CRC\n\n`wget <https://huggingface.co/jinaai/jina-embeddings-v2-base-en/resolve/main/pytorch_model.bin?download=true> -O pytorch_model.bin`\n\n2.  Attempt to scan the corrupted ZIP file with PickleScan:\n\n```\n# Assuming you have Picklescan installed and in your PATH\npicklescan -p pytorch_model.bin\n```\n\n![Screenshot 2025-06-29 at 13 52 07](https://github.com/user-attachments/assets/b7d7aca2-b7cd-4e7d-92f8-32ca4c42a000)\n**Observed Result**: Picklescan returns no results and presents an error message indicating a problem with the ZIP file, but it doesn’t attempt to scan any potentially valid pickle files within the archive.\n\n**Expected Result:** Picklescan should either:\n\n- Attempt to extract and scan other valid files within the ZIP archive, even if some have CRC errors.\n- Report a warning indicating that the ZIP archive has CRC errors and might be incomplete or corrupted, but still attempt to scan any accessible content.\n\n### Impact\n**Severity**: High \n**Affected Users**: Any organization or individual using Picklescan to analyze PyTorch models or other files distributed as ZIP archives for malicious pickle content.\n**Impact Details**: Attackers can craft malicious PyTorch models containing embedded pickle payloads, package them into ZIP archives, and intentionally introduce CRC errors. This would cause Picklescan to fail to analyze the archive, while PyTorch is still able to load the model (depending on its configuration regarding CRC checks). This creates a significant vulnerability where malicious code can be distributed and potentially executed without detection by Picklescan.\n**Ex: Picklescan on HuggingFace goes into error** (https://huggingface.co/jinaai/jina-embeddings-v2-base-en/tree/main)\n![Screenshot 2025-06-29 at 13 55 58](https://github.com/user-attachments/assets/1da2d2ce-ad3e-4bf1-addc-d8a18db5eac9)\n\n**Recommendations:**\nPicklescan should not fail on Bad CRC check, especially if Pytorch is not checking CRC.\nRelaxed Zipfile is perfect to fix this issue:\n```\n--- picklescan/src/picklescan/relaxed_zipfile.py\n+++ picklescan/src/picklescan/relaxed_zipfile.py\n@@ class RelaxedZipFile(zipfile.ZipFile):\n         try:\n             # Skip the file header:\n             fheader = zef_file.read(sizeFileHeader)\n             if len(fheader) != sizeFileHeader:\n                 raise zipfile.BadZipFile(\"Truncated file header\")\n\n             fheader = struct.unpack(structFileHeader, fheader)\n             if fheader[_FH_SIGNATURE] != stringFileHeader:\n                 raise zipfile.BadZipFile(\"Bad magic number for file header\")\n\n             zef_file.read(fheader[_FH_FILENAME_LENGTH])\n             if fheader[_FH_EXTRA_FIELD_LENGTH]:\n                 zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])\n\n-            return zipfile.ZipExtFile(zef_file, mode, zinfo, pwd, True)\n+\n+            # Create the ZipExtFile and disable CRC check\n+            ext_file = zipfile.ZipExtFile(zef_file, mode, zinfo, pwd)\n+            # Monkey-patch to skip CRC validation\n+            ext_file._expected_crc = None\n+            return ext_file\n\n         except BaseException:\n             zef_file.close()\n             raise\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "picklescan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.31"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.0.30"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-mjqp-26hc-grxg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-10156"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/commit/28a7b4ef753466572bda3313737116eeb9b4e5c5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mmaitre314/picklescan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/blob/v0.0.29/src/picklescan/relaxed_zipfile.py#L35"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/picklescan/PYSEC-2025-152.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huggingface.co/jinaai/jina-embeddings-v2-base-en/resolve/main/pytorch_model.bin?download=true"
  }, {
    "type" : "WEB",
    "url" : "https://huggingface.co/jinaai/jina-embeddings-v2-base-en/tree/main"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-693", "CWE-755" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-10T19:50:46Z",
    "nvd_published_at" : null
  }
}