picklescan - Universal Blocklist Bypass via pkgutil.resolve_name
Description
picklescan before 1.0.4 fails to block pkgutil.resolve_name, allowing attackers to bypass the entire blocklist by resolving any dangerous function through indirect REDUCE calls. Remote attackers can invoke any blocked function such as os.system, builtins.exec, or subprocess.call to achieve remote code execution.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1- Range: <1.0.4
Patches
Vulnerability mechanics
Root cause
"picklescan's blocklist omits pkgutil and the opcode scanner does not inspect REDUCE arguments, enabling an indirect resolution gadget that bypasses all blocklist entries."
Attack vector
An attacker crafts a pickle file that uses `STACK_GLOBAL` to push `pkgutil.resolve_name` onto the stack, then calls `REDUCE` with the string `"os:system"` (or any other blocked function name) to obtain the actual function object. A second `REDUCE` call invokes that function with an attacker-controlled argument (e.g., a shell command). Because picklescan only checks `GLOBAL`/`INST`/`STACK_GLOBAL` opcodes against its blocklist and does not inspect `REDUCE` arguments, the scan reports zero issues while `pickle.loads` executes arbitrary code [ref_id=1].
Affected code
picklescan's `_unsafe_globals` blocklist (in versions ≤1.0.3) does not include `pkgutil`, and the opcode scanner only inspects `GLOBAL`/`INST`/`STACK_GLOBAL` opcodes — it never analyzes the arguments passed to `REDUCE` calls. This allows an attacker to chain two `REDUCE` calls: the first resolves `pkgutil.resolve_name` (which is not blocked), and the second invokes the resolved dangerous function (e.g., `os.system`) without that function ever appearing in an import opcode [ref_id=1].
What the fix does
The advisory recommends adding `"pkgutil": {"resolve_name"}` to `_unsafe_globals` and also blocking `importlib` and `importlib.util` to prevent similar indirect resolution gadgets. However, the advisory notes that the blocklist approach is fundamentally fragile — even after blocking `pkgutil`, an attacker could find other stdlib functions that resolve module attributes. The suggested architectural fix is to analyze `REDUCE` arguments for suspicious strings, treat unknown globals as dangerous by default, or switch to an allowlist model [ref_id=1].
Preconditions
- inputThe victim must unpickle attacker-controlled pickle data using Python's pickle.loads (or equivalent).
- configThe system must have picklescan installed (version ≤1.0.3) and rely on it for safety validation.
Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-vvpj-8cmc-gx39ghsaADVISORY
- github.com/mmaitre314/picklescan/security/advisories/GHSA-vvpj-8cmc-gx39ghsavendor-advisory
- www.vulncheck.com/advisories/picklescan-universal-blocklist-bypass-via-pkgutil-resolve-nameghsathird-party-advisory
- nvd.nist.gov/vuln/detail/CVE-2026-3490ghsa
News mentions
0No linked articles in our index yet.