# picklescan missing detection of cProfile.runctx in reduce methods

Source: https://junglewise.ai/threats/picklescan-missing-detection-of-cprofile-runctx-in-reduce-methods-559febe6  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-21. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: high · CVSS 8.1 · Published 2026-06-21

picklescan is a security library used to scan Python pickle files for potentially malicious code before loading them. Attackers can craft pickle files that call Python's built-in cProfile.runctx function to execute arbitrary commands, bypassing picklescan's detection. When a user loads such a file after checking it with picklescan, the attacker gains remote code execution on the system.

Technologies: [picklescan (PyPI)](https://junglewise.ai/threats/technologies/picklescan). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 8.1, published 21 June 2026.

**Which products and versions are affected?** picklescan (PyPI) < 0.0.30.

**Is there a fix for This vulnerability?** A patch was published on 2026-06-21: Version 0.0.30 released with fix Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run picklescan (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

This vulnerability is a deserialization bypass (CWE-502) in picklescan's detection logic. The root cause is that picklescan fails to identify cProfile.runctx, a built-in Python profiling function that can execute arbitrary code, when it is called via the __reduce__ method in pickle serialization. An attacker constructs a malicious pickle file containing cProfile.runctx(cmd, globals, locals) in the reduce method, which effectively calls exec(cmd, ...) at deserialization time. The attack requires user interaction (victim must call pickle.load() on an untrusted file) but no privileges; it is exploitable over the network if the pickle file can be transmitted remotely. The vulnerability affects picklescan versions before 0.0.30, which includes a patch to detect this function call pattern.

## Affected products

- mmaitre314 picklescan < 0.0.30

## Timeline

- 2026-06-21: disclosed: Advisory published
- 2026-06-21: patched: Version 0.0.30 released with fix

## References

- [https://github.com/mmaitre314/picklescan/security/advisories/GHSA-9w88-8rmg-7g2p](https://github.com/mmaitre314/picklescan/security/advisories/GHSA-9w88-8rmg-7g2p)
- [https://www.vulncheck.com/advisories/picklescan-remote-code-execution-via-undetected-cprofile-runctx-in-pickle-files](https://www.vulncheck.com/advisories/picklescan-remote-code-execution-via-undetected-cprofile-runctx-in-pickle-files)

## Related threats

- [picklescan detection bypass via _operator.methodcaller](https://junglewise.ai/threats/cve-2025-71375-picklescan-detection-bypass-via-operator-methodcaller)
- [picklescan security bypass via operator.methodcaller](https://junglewise.ai/threats/cve-2025-71373-picklescan-security-bypass-via-operator-methodcaller)
- [Picklescan detection bypass via numpy getlincoef gadget](https://junglewise.ai/threats/cve-2025-71372-picklescan-detection-bypass-via-numpy-getlincoef-gadget)
- [picklescan safety check bypass via PyTorch decoder basichandlers](https://junglewise.ai/threats/cve-2025-71369-picklescan-safety-check-bypass-via-pytorch-decoder-basichandlers)
- [picklescan security bypass via _operator.attrgetter function call](https://junglewise.ai/threats/cve-2025-71367-picklescan-security-bypass-via-operator-attrgetter-function-call)
