GHSA-f4x7-rfwp-v3xw: Picklescan Picklescan Missing Detection When Calling Vulnerability

MODERATE
CWE-345
Published
Advisory Summary

GHSA-f4x7-rfwp-v3xw is a MODERATE picklescan missing detection when calling vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Picklescan libraries in the PyPI ecosystem. The issue involves picklescan missing detection when calling pytorch function torch.fx.experimental.symbolic_shapes.shapeenv.evaluate_guards_expression. Remediation is available by upgrading affected packages to version 0.0.28.

GHSA-f4x7-rfwp-v3xw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f4x7-rfwp-v3xw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Picklescan
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-f4x7-rfwp-v3xw

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.28
pip install picklescan>=0.0.28
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 GHSA-f4x7-rfwp-v3xw, 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.28), 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 Using torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression function, which is a pytorch library function to execute remote pickle file. ### Details The attack payload executes in the following steps: First, the attacker craft the payload by calling to torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression function in reduce method 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 ``` import types import torch.fx.experimental.symbolic_shapes as symbolic_shapes class EvilTorchFxSymbolicShapesEvaluateGuardsExpression: def __reduce__(self): fake_self = str code = "__import__('os').system('whoami')" args = [] return symbolic_shapes.ShapeEnv.evaluate_guards_expression, (fake_self, code, args) ``` ### Impact 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. ### Corresponding https://github.com/FredericDT https://github.com/Qhaoduoyu

GHSA-f4x7-rfwp-v3xw Affected Picklescan Versions

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

References

Frequently Asked Questions

What is GHSA-f4x7-rfwp-v3xw?
GHSA-f4x7-rfwp-v3xw is a security vulnerability in Picklescan involving Picklescan missing detection when calling pytorch function torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression under CWE-345: Insufficient Verification of Data Authenticity.
Which Picklescan versions are affected?
Affected versions include releases prior to 0.0.28 across affected packages: picklescan.
What version fixes GHSA-f4x7-rfwp-v3xw?
Upgrading to 0.0.28 (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.28. Upgrade your dependency to 0.0.28 or later.
What CWE is associated with GHSA-f4x7-rfwp-v3xw?
GHSA-f4x7-rfwp-v3xw 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 GHSA-f4x7-rfwp-v3xw?
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-f4x7-rfwp-v3xw",
  "modified" : "2025-08-22T16:56:53Z",
  "published" : "2025-08-22T16:56:53Z",
  "aliases" : [ ],
  "summary" : "Picklescan missing detection when calling pytorch function torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression",
  "details" : "### Summary\n\nUsing torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression function, which is a pytorch library function to execute remote pickle file.\n\n### Details\n\nThe attack payload executes in the following steps:\n\nFirst, the attacker craft the payload by calling to torch.fx.experimental.symbolic_shapes.ShapeEnv.evaluate_guards_expression function in reduce method\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\n\n```\nimport types\nimport torch.fx.experimental.symbolic_shapes as symbolic_shapes\n\nclass EvilTorchFxSymbolicShapesEvaluateGuardsExpression:\n    def __reduce__(self):\n        fake_self = str\n        code = \"__import__('os').system('whoami')\"\n        args = []\n        return symbolic_shapes.ShapeEnv.evaluate_guards_expression, (fake_self, code, args)\n```\n\n### Impact\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\n### Corresponding\n\nhttps://github.com/FredericDT\nhttps://github.com/Qhaoduoyu",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "picklescan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.28"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.0.27"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-f4x7-rfwp-v3xw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/pull/47"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/commit/7f994d62084fe43f1cffdef2f9bae6923344ef53"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mmaitre314/picklescan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mmaitre314/picklescan/releases/tag/v0.0.28"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-22T16:56:53Z",
    "nvd_published_at" : null
  }
}