/

CVE-2026-22606

Severity:

HIGH RISK

(7.8)

Security Policy Bypass / Incomplete Input Validation

CVE-2026-22606

Analyzed

Vulnerability type

Category:

Security Policy Bypass / Incomplete Input Validation

CWE:

CWE-184, CWE-502

Impact:

Security Control Bypass Leading to Remote Code Execution via Unsafe Deserialization

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Fickling, a Python pickle decompiler and static analyzer, incorrectly classifies pickles that invoke Python's runpy module as only SUSPICIOUS instead of OVERTLY_MALICIOUS.

When Fickling is used as a security gate for pickle deserialization, this misclassification can mislead users or automated systems into treating dangerous pickles as safe enough to execute, potentially resulting in arbitrary attacker-controlled code running on the host system.

Affected context

This issue affects any environment where:

  • Python pickle data is accepted from potentially untrusted or semi-trusted sources, and
  • Fickling (≤ 0.1.6) is used as a gatekeeper to decide whether that pickle is safe to load, and
  • Security policies or workflows depend on Fickling's severity classification (e.g., BENIGN, SUSPICIOUS, OVERTLY_MALICIOUS) to allow or block deserialization.

In such contexts, pickles that leverage runpy.run_path() or runpy.run_module() for code execution are not treated as clearly malicious, reducing the strength of the security control that Fickling is expected to provide.

Exploit preconditions

  • Attack surface: Any API, file upload, message queue, or data channel where an attacker can supply Python pickle payloads that will be evaluated by Fickling.
  • Required access: Ability to craft and submit arbitrary pickle data that is analyzed by Fickling before potential deserialization.
  • Trigger point: A workflow, tool, or product that:
  • Invokes Fickling ≤ 0.1.6 on the pickle, and
  • Uses Fickling's "SUSPICIOUS vs. OVERTLY_MALICIOUS" distinction to make a decision (e.g., only blocking OVERTLY_MALICIOUS payloads), and
  • Proceeds to deserialize pickles marked as SUSPICIOUS under certain conditions (such as manual override, looser policy, or automated acceptance).
  • Why exploitation is possible: The analyzer's ruleset does not treat the runpy module as inherently dangerous, so payloads that can achieve code execution via runpy.run_path() or runpy.run_module() evade the strictest classification, effectively weakening or bypassing the intended security policy.

Why this happens

The underlying bug is a security policy and classification gap in Fickling's static analysis logic.

Specifically, the tool's threat model and rule configuration failed to consider Python's runpy module as a high-risk execution primitive, even though runpy.run_path() and runpy.run_module() can load and execute arbitrary Python code.

This aligns with:

  • CWE-184: Incomplete Blacklist / Improper Enforcement of Behavioral Policy, because the tool maintains a list or heuristic of dangerous behaviors but omits runpy, allowing malicious behavior to slip into a weaker risk category.
  • CWE-502: Deserialization of Untrusted Data, in that the tool is intended to mitigate unsafe pickle deserialization but misclassifies a code-executing pattern, reducing the effectiveness of protections against this class of deserialization attack.

Abstractly, the insecure pattern is: a security control relies on partial knowledge of dangerous sinks; some powerful "indirect code execution" APIs are not treated as strictly malicious, so payloads using them are under-classified and may be allowed through.

Potential impact

  • Attackers could cause arbitrary Python code execution when a misclassified pickle is eventually deserialized.
  • Local system compromise, including access to application data and credentials available to the Python process.
  • Execution of follow-on actions such as installing malware, exfiltrating data, or modifying application behavior.
  • Compromise of CI/CD or analysis pipelines that automatically process untrusted pickles under the assumption that Fickling's classification is authoritative.
  • Erosion of trust in higher-level products or workflows that use Fickling as part of their security decision-making.

General mitigation guidance

Mitigation centers on treating pickle deserialization as inherently dangerous and not relying solely on best-effort static analysis:

  • Prefer serialization formats without code execution semantics (e.g., JSON, MessagePack, or protocol buffers) for untrusted data, avoiding pickle entirely in security-sensitive paths.
  • Architect workflows so that untrusted pickles are never deserialized in the same trust domain as critical secrets, business logic, or administrative capabilities.
  • Treat any indication of "SUSPICIOUS" behavior from an analyzer as grounds for rejection or heavy isolation, rather than permitting deserialization by default.
  • Introduce a defense-in-depth policy that assumes analysis tools can have blind spots; require additional validation or sandboxing when working with complex or user-controlled pickle data.
  • When security tools are used as gates (like Fickling), define strict policy thresholds (e.g., "only explicitly BENIGN is allowed") rather than tolerating medium-risk classifications.
  • Apply least-privilege to any process that must deserialize pickles: restrict filesystem access, network access, environment variables, and access to sensitive APIs to limit damage if malicious code executes.

How teams detect issues like this

High-level approaches to detect and guard against this class of issue include:

  • Static analysis & code scanning:
  • Search for pickle.load, pickle.loads, and equivalent deserialization APIs (including dill, cloudpickle, etc.) in code that touches untrusted data.
  • Flag locations where deserialization decisions are based on security tool classifications (e.g., Fickling output) rather than strict allow/deny policies.
  • Identify uses of high-risk execution primitives (runpy, exec, eval, dynamic imports) that could be abused indirectly by deserialized content.
  • Security policy review:
  • Review how Fickling or similar tools are integrated into pipelines (CI, data ingestion, artifact analysis) and verify that medium-risk categories cannot silently pass through to deserialization.
  • Ensure that documentation and runbooks explicitly state what classifications result in blocking vs. allowing deserialization.
  • Runtime and behavioral monitoring:
  • Monitor processes that deserialize pickles for unexpected module loads, file reads, or network calls following analysis that appears permissive.
  • Use sandboxing or containerization for pickle processing, enabling anomaly detection and easy teardown if malicious behavior is observed.
  • Tooling validation:
  • Periodically test security tools with known malicious pickle samples (including runpy-based payloads) to validate that policy classifications align with organizational risk tolerance.
  • Incorporate security regression tests to ensure that updates to analysis tools or rules do not weaken enforced policy over time.

Sources

SourceLink
github.comgithub.com/trailofbits/fickling/commit/9a2b3f89bd0598b528d62c10a64c1986fcb09f66
github.comgithub.com/trailofbits/fickling/releases/tag/v0.1.7
github.comgithub.com/trailofbits/fickling/security/advisories/GHSA-wfq2-52f7-7qvj

Frequently asked

questions

Exploitability depends on how heavily you rely on Fickling's classifications. If your workflow automatically deserializes pickles that Fickling labels as SUSPICIOUS (or treats SUSPICIOUS as "probably safe"), an attacker who can supply pickle data can craft runpy-based payloads to trigger code execution. If you already treat any non-BENIGN result as a hard block or only deserialize pickles from fully trusted sources, the practical risk is lower.

An attacker must be able to provide or influence a pickle that is analyzed by Fickling and may later be deserialized. This could be via file uploads, API requests, shared artifacts in CI/CD, or any channel that feeds into a pickle-processing pipeline. They do not need shell access to the target system; they only need the ability to introduce crafted pickle content into the workflow.

The most robust pattern is to treat pickles as untrusted code and avoid deserializing them from untrusted or semi-trusted sources altogether. Where deserialization is unavoidable, combine multiple layers: use stricter acceptance policies (e.g., only allow known-good sources and formats), isolate the deserialization process in a sandboxed environment with minimal privileges, and treat any analyzer warnings (SUSPICIOUS or worse) as a reason to reject the payload outright.

Build security processes that assume analysis tools are fallible and may have blind spots. This means:

  • Avoid single points of failure in security decisions (do not rely on one tool's classification as the sole gate).
  • Use safer data interchange formats when possible and treat deserialization as high risk.
  • Regularly review and test your security tools with known malicious samples to validate their coverage.
  • Codify strict policies around untrusted data handling and enforce them in CI/CD and runtime environments, ensuring that human or automated decisions do not override caution based solely on partial classifications.
Find out what's already
exploitable in your codebase.