---
id: "CVE-2026-118938"
kind: "vulnerability"
aliases: ["CVE-2026-118938"]
title: "fickling: crafted pickle bypasses safety check and runs code"
severity: "high"
cvss: 8.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["fickling", "ml-model-loading", "package", "python"]
not_affected_if: ["fickling-not-used-as-gate", "no-untrusted-pickles"]
published_at: "2026-10-30T22:16:54+00:00"
first_seen_at: "2026-10-30T22:25:56+00:00"
updated_at: "2026-10-30T22:27:06+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118938", "first_seen_at": "2026-10-30T22:25:56+00:00"}]
---

# fickling: crafted pickle bypasses safety check and runs code

Trail of Bits' fickling, a pickle safety scanner, can be fooled by a pickle file with a dotted name that reaches optparse.Values.read_file, which executes code. An attacker who supplies a crafted pickle gets arbitrary code execution on a system that loads it after check_safety() reports it as safe.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `pip show fickling` and compare against the range through 0.1.12.
- Search code for `fickling.load(` or `check_safety(` used as the gate before `pickle.loads(`.

## Fix

- fickling: unknown (the sources state no fixed version; the vendor master branch at commit d011709 was reported still vulnerable).

## Timeline

- 2026-10-30T22:25:56+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118938

## From the sources

In Trail of Bits fickling through 0.1.12, a pickle STACK_GLOBAL operand carrying a dotted __qualname__ (for example "Values.read_file") is resolved by pickle's find_class through _getattribute to an arbitrary attribute path rather than to a module-level function. Fickling records only the leading component of the name in its import tracking and renders the operation as a plain import (for instance, 'python -m fickling' displays it as 'from optparse import Values.read_file'), so the trailing attribute reference is never analyzed as a call. The OvertlyBadEvals analysis pass does not flag it, and check_safety() returns LIKELY_SAFE with zero findings. This allows an attacker to reach a class method that performs code execution: optparse.Values.read_file executes exec(open(filename).read(), vars), achieving arbitrary code execution when the crafted pickle is loaded through fickling.load(), which chains check_safety() into pickle.loads() as an explicit security gate. optparse is present in all current CPython 3.x releases (deprecated as of Python 3.13, not removed). This weakness is in the resolution and analysis of dotted attribute-path names, and is distinct from and independently fixable from the module-origin trust weakness tracked as CVE-2026-16760: resolving or flagging dotted attribute-path imports closes this vector while leaving the module-level trust behavior unchanged. This bypass was verified to remain present on the vendor master branch at commit d011709 as of 2026-10-30, after the vendor's October blocklist additions and a new heuristic that flags private stdlib attributes; because the public class method Values.read_file is neither blocklisted nor flagged as a private attribute, it is not addressed by those remediations.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
