HIGH 8.1

CVE-2025-71378: picklescan Bypass via cProfile.runctx Detection Gap

picklescan is a security tool designed to detect malicious code hidden in Python pickle files before they're loaded. A vulnerability in picklescan versions before 0.0.30 allows attackers to hide malicious code using the cProfile.runctx function in ways the tool fails to recognize. When a user thinks they're safely loading a scanned pickle file, the malicious code executes anyway, potentially giving attackers full control of the system. The vulnerability requires user interaction—someone must actually load the pickle file—but once they do, the attacker can run arbitrary commands.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.1 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weaknesses (CWE)
CWE-502
Affected products
1 configuration(s)
Published / Modified
2026-06-21 / 2026-06-26

NVD description (verbatim)

picklescan before 0.0.30 fails to detect cProfile.runctx function calls in pickle file reduce methods, allowing attackers to execute arbitrary code. Malicious pickle files bypass picklescan detection and execute remote code when loaded via pickle.load().

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2025-71378 exploits a detection bypass in picklescan's analysis logic. The vulnerability stems from incomplete handling of cProfile.runctx function calls within pickle reduce methods. Pickle's reduce protocol allows serialized objects to specify custom deserialization behavior. By embedding cProfile.runctx calls in reduce methods, attackers craft pickle files that pass picklescan's safety checks but execute arbitrary code when deserialized via pickle.load(). This is classified as CWE-502 (Deserialization of Untrusted Data), a well-known attack vector in Python ecosystems. The CVSS 3.1 score of 8.1 reflects high impact (confidentiality and integrity compromise) with network accessibility and low complexity.

Business impact

Organizations relying on picklescan to safely validate pickle files before processing them face a significant trust gap. If pickle files are ingested from untrusted sources—common in data science workflows, distributed systems, or model serving architectures—attackers can bypass the security control entirely. The impact extends to confidentiality (data exfiltration) and integrity (data manipulation), though availability isn't directly impacted. This is particularly concerning in ML/data science environments where pickle is the standard serialization format and automated pipelines may load files with minimal human oversight.

Affected systems

The vulnerability affects picklescan versions prior to 0.0.30. Any system or application using an affected version of picklescan to validate pickle files before deserialization is vulnerable. This includes data science platforms, machine learning pipelines, model repositories, and any custom tools that depend on picklescan for security validation.

Exploitability

Exploitability is moderately straightforward. An attacker must craft a malicious pickle file using cProfile.runctx in a reduce method—a technique requiring pickle expertise but not particularly sophisticated. The pickle file must then reach a target that (1) runs picklescan to validate it and (2) subsequently loads it via pickle.load(). User interaction is required in the sense that a person or process must initiate the pickle loading, but no social engineering or complex weaponization is necessary. Public exploit code is not widely documented, but the technique is within reach of competent adversaries.

Remediation

Upgrade picklescan to version 0.0.30 or later immediately. This version patches the detection logic to properly recognize and block cProfile.runctx function calls in reduce methods. Organizations should verify the version of picklescan in their environment, including in transitive dependencies. After patching, re-validate any existing pickle files that were previously scanned with the vulnerable version.

Patch guidance

Update picklescan to 0.0.30 or later. If using package management (pip), run 'pip install --upgrade picklescan'. Verify the update with 'pip show picklescan' to confirm the version is 0.0.30 or higher. For containerized or locked environments, update your requirements.txt, pyproject.toml, or equivalent dependency file and rebuild. Test the updated version against your existing pickle file processing to ensure compatibility. No breaking changes are expected with this patch.

Detection guidance

Monitor for pickle.load() or unpickle operations in your codebase and logs. If using picklescan, verify logs show it's running version 0.0.30+. If you have samples of pickle files validated with earlier versions of picklescan, consider re-scanning them with the patched version. Behavioral detection should focus on unexpected subprocess execution or system calls originating from Python pickle deserialization—look for cProfile-related execution or unusual child processes spawned during data pipeline runs.

Why prioritize this

This vulnerability merits immediate attention because picklescan is a security tool; its compromise directly undermines trust in the validation layer. The high CVSS score (8.1) reflects realistic attack impact. While KEV status is not currently assigned, the detection bypass nature and pickle's ubiquity in Python ecosystems means this will likely be actively exploited in targeted campaigns. Organizations with data pipelines processing external pickle files face elevated risk.

Risk score, explained

The CVSS 3.1 score of 8.1 (HIGH) is driven by: (1) Network accessibility (AV:N)—malicious pickle files can arrive remotely; (2) Low attack complexity (AC:L)—no special conditions required beyond crafting a valid pickle; (3) No privilege escalation needed (PR:N); (4) High confidentiality and integrity impact (C:H/I:H)—arbitrary code execution compromises both. Availability is not impacted (A:N), preventing a critical rating. The user interaction requirement (UI:R) prevents a higher score, but does not eliminate risk in automated environments.

Frequently asked questions

Can picklescan protect us from all malicious pickle files?

Picklescan aims to detect dangerous pickle operations, but as this CVE demonstrates, it has had blind spots. No security tool is perfect. Picklescan should be one layer in a defense-in-depth strategy. Additional controls include: only loading pickle files from trusted sources, running deserialization in isolated environments, using safer serialization formats (JSON, Protocol Buffers) when possible, and applying least-privilege principles to the process that loads pickles.

Do we need to worry if we never load pickle files from external sources?

Your risk is substantially lower if all pickle files are generated and consumed entirely within your controlled environment. However, you should still patch to 0.0.30+ because: (1) you may not know all the pickle sources in your infrastructure; (2) supply chain attacks could introduce malicious pickles; (3) staying current on security patches is a baseline practice. If you're absolutely certain no external pickles are processed, prioritize accordingly, but verification is important.

What's the difference between this vulnerability and the general pickle deserialization risk in Python?

Pickle deserialization itself is inherently risky (CWE-502), and this has been known for years. The standard advice is to avoid pickle or use it only for trusted data. This CVE is a *specific* bypass of picklescan, a tool designed to mitigate pickle risk. The vulnerability exposes a gap in that mitigation—it doesn't make pickle inherently more dangerous, but it means picklescan isn't catching this particular attack vector.

If we update picklescan, do our old pickle files suddenly become dangerous?

No. Updating picklescan does not change the status of previously scanned pickle files. However, if you re-scan old pickles with the new version and it *now* detects something it missed before, that's a signal that the file may have been problematic and should be investigated or discarded. This is actually a benefit—the patch helps identify previously undetected malicious files.

This analysis is provided for informational purposes and reflects information available as of the publication date. CVSS scores and vulnerability assessments are based on vendor data and may be subject to change. Organizations should verify patch availability and compatibility with their specific configurations. No guarantee is made regarding exploit availability, active exploitation, or real-world impact in any particular environment. Always consult official vendor advisories and security bulletins before implementing mitigations. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).