/

CVE-2026-22608

Severity:

HIGH RISK

(7.8)

Unsafe Deserialization with Incomplete Security Filtering

CVE-2026-22608

Analyzed

Vulnerability type

Category:

Unsafe Deserialization with Incomplete Security Filtering

CWE:

CWE-184, CWE-502

Impact:

Remote Code Execution via Bypassed Pickle Safety Scan

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 pickling decompiler and static analyzer, failed to explicitly block dangerous uses of ctypes and pydoc prior to version 0.1.7, allowing malicious pickle payloads to be marked as "LIKELY_SAFE".

By chaining pydoc.locate with ctypes, an attacker can achieve remote code execution (RCE) while evading the scanner's detection, making any workflow that "trusts" Fickling's verdict vulnerable if it processes untrusted pickle data.

Affected context

This vulnerability affects environments that:

  • Use Fickling to statically analyze or gate Python pickle files for safety
  • Treat a "LIKELY_SAFE" scan result as a trust signal for loading or further processing pickles
  • Accept or process pickle data from sources that may be influenced by an attacker

The issue arises because dangerous code paths via pydoc.locate and ctypes were not explicitly modeled as unsafe, allowing attacker-controlled pickle opcodes to be constructed that slip past Fickling's checks.

Exploit preconditions

  • Attack surface: Any service, pipeline, or review process that relies on Fickling's analysis to assess the safety of pickle files.
  • Required access: Ability to supply or influence serialized pickle content that will be scanned by Fickling and potentially later executed or loaded.
  • Trigger point: The malicious pickle is scanned and flagged as "LIKELY_SAFE" by Fickling, and then a downstream component deserializes or otherwise executes it based on that assurance.
  • Why exploitation is possible: Fickling's detection logic did not consider combinations of pydoc.locate and ctypes as dangerous, leading to an incomplete blacklist / insufficient regular expression (CWE-184) over an already hazardous deserialization mechanism (CWE-502).

Why this happens

The underlying bug stems from relying on a finite, incomplete list of known-dangerous constructs when analyzing Python pickles, rather than modeling the broader capability of dynamic object loading and execution.

Specifically, the scanner did not treat pydoc.locate and ctypes as high-risk primitives, even though they can dynamically resolve and invoke arbitrary objects, including system-level functions.

This reflects CWE-184: Incomplete Blacklist / Incomplete Whitelist, where security checks miss viable attacker-controlled paths, combined with CWE-502: Deserialization of Untrusted Data, because the ecosystem around pickle inherently allows code execution during object reconstruction.

As a result, a crafted pickle can chain permitted operations to reach effective code execution while the analyzer incorrectly labels the payload as safe.

Potential impact

  • Malicious pickle files may be incorrectly classified as safe by Fickling.
  • Remote code execution in applications or tools that load pickle data based on Fickling's safety assessment.
  • Compromise of CI/CD pipelines or security review workflows that use Fickling as a gatekeeper.
  • Lateral movement or data exfiltration from systems that deserialize attacker-supplied pickles after passing the scan.
  • Erosion of trust in automated pickle analysis and potential exploitation of similar blind spots in other scanning tools.

General mitigation guidance

Effective mitigation focuses on both reducing reliance on pickle trust decisions and hardening static analysis:

  • Avoid deserializing untrusted pickles: Treat Python pickle as inherently unsafe for untrusted data; use safer serialization formats (e.g., JSON, MessagePack, or domain-specific schemas) for cross-boundary data exchange.
  • Defense-in-depth over scanners: Do not treat any static analyzer's "safe" label as a sole authorization signal to deserialize; couple analysis with strict input trust policies and architectural constraints.
  • Model dynamic resolution as dangerous: When building or configuring scanners, treat functions like pydoc.locate, eval, dynamic imports, and FFI interfaces (like ctypes) as high-risk primitives.
  • Use allowlists instead of blocklists: Prefer whitelisting a small set of benign, well-understood types or modules that can be reconstructed, rather than attempting to enumerate and block every dangerous path.
  • Privilege and isolation: Run any component that must deserialize pickle data with minimal privileges and in isolated sandboxes or containers, reducing the blast radius of a potential compromise.

How teams detect issues like this

To detect similar issues and misuse patterns, teams can apply multiple layers of review:

  • Static analysis for dynamic primitives: Scan source code for uses of pickle, cPickle, dill, cloudpickle, pydoc.locate, and ctypes in code paths that handle external or untrusted data.
  • Pattern-based rules in scanners: Extend or configure SAST tools to flag deserialization flows that call or resolve dynamic execution primitives, not just explicit known-dangerous functions.
  • Code review signals: During review, treat any new or expanded use of pickle and reflection-like APIs as a security-sensitive change requiring explicit justification and threat modeling.
  • Policy enforcement: Enforce organizational guidelines that prohibit untrusted pickle deserialization and require documented exceptions, possibly with CI policies that block merges introducing unsafe patterns.
  • Cross-tool validation: Periodically test pickle analyzers (including Fickling and others) with known malicious payloads to verify that detection rules correctly identify dangerous constructs and combinations.

Sources

SourceLink
github.comgithub.com/trailofbits/fickling/commit/b793563e60a5e039c5837b09d7f4f6b92e6040d1
github.comgithub.com/trailofbits/fickling/releases/tag/v0.1.7
github.comgithub.com/trailofbits/fickling/security/advisories/GHSA-5hvc-6wx8-mvv4

Frequently asked

questions

Not by itself. Exploitation depends on a workflow where an attacker can provide pickle data that is scanned by Fickling and later deserialized or executed based on the scanner's "LIKELY_SAFE" classification. The actual network exposure depends on where and how pickle inputs are accepted.

The attacker needs the ability to influence or supply pickle files that will be analyzed by Fickling and subsequently trusted by another component. This can occur via file uploads, API endpoints, shared artifact repositories, or any other channel that feeds into a pipeline using Fickling.

The most robust approach is to stop deserializing untrusted pickle data altogether and migrate to safer serialization formats. Where pickle cannot be removed, apply a strict allowlist of permitted types, sandbox deserialization, and update analysis tools so they treat dynamic resolution mechanisms like pydoc.locate and ctypes as dangerous.

Preventative strategies include designing systems under the assumption that pickle is unsafe for untrusted input, using schema-based serialization whenever data crosses trust boundaries, and treating static analyzers as advisory rather than authoritative. Security reviews should scrutinize any new deserialization logic, and automated tools should be regularly tested against crafted payloads to discover blind spots in their detection logic.

Find out what's already
exploitable in your codebase.