CVE-2026-16760

Fickling check_safety() bypass: likely_safe_imports grants module-origin trust to unvalidated standard library callables

Published Oct 30, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
In Trail of Bits fickling through 0.1.12, the _process_import() method in fickle.py adds an imported name to the likely_safe_imports set whenever the source module is present in sys.stdlib_module_names and the name is absent from the UNSAFE_IMPORTS denylist, without inspecting what the name resolves to or how it behaves. The OvertlyBadEvals analysis pass in analysis.py then unconditionally skips any call whose function name appears in likely_safe_imports, including calls that would otherwise be flagged as overtly dangerous. As a result, any callable reachable through a non-blocked standard library module inherits module-level trust regardless of its own behavior, and check_safety() returns LIKELY_SAFE with zero findings for pickle payloads that reach code execution or file write through such callables. Demonstrated primitives: dataclasses._create_fn, which passes an attacker-controlled function body to exec() and yields arbitrary code execution on Python 3.7 through 3.12 (the internal _create_fn function was removed in Python 3.13); mailcap.findmatch, which internally calls os.system() on a test command taken from an attacker-controlled caps dictionary, yielding arbitrary code execution on Python versions through 3.12 (the mailcap module was removed in Python 3.13); and readline.add_history() followed by readline.write_history_file(), which writes attacker-controlled content to an arbitrary filesystem path (POSIX platforms, where the readline module is available). fickling.load() chains check_safety() into pickle.loads() as an explicit security gate, so a LIKELY_SAFE verdict causes the payload to be deserialized and executed with the privileges of the victim process. The root cause is the inference of callable safety from module origin; it is independent of, and separately fixable from, the dotted __qualname__ resolution weakness tracked as CVE-2026-118938, which this advisory does not address. As of 2026-10-30 the three demonstrated modules were added to UNSAFE_IMPORTS on the vendor master branch (commit d011709) pending release; released versions through 0.1.12 remain affected, and the module-origin trust root cause persists, as demonstrated by the related CVE-2026-118938 remaining exploitable on that same build.

Analysis

AI-generated

Technical impact

In Trail of Bits fickling up to version 0.1.12, a flaw in the _process_import() routine assigns an imported name to a set that marks it as likely safe whenever the source module belongs to the standard library and the name is not on an explicit denylist. The tool’s analysis pass then suppresses any call to a function whose name appears in that set, even if the function is itself dangerous. Consequently, any callable reachable through these trusted standard library modules inherits module-level trust, and the safety check reports LIKELY_SAFE with no findings for pickle payloads that exploit the behavior of such callables. The demonstrated primitives—dataclasses._create_fn (executing arbitrary code via exec), mailcap.findmatch (executing commands through os.system), and readline.add_history/write_history_file (writing arbitrary content to a file)—confirm that an attacker can gain remote code execution or file write through a malicious pickle payload.

Affected Systems

The issue affects the Trail of Bits fickling library, specifically releases up through 0.1.12. Vulnerable Python standard library modules involved include dataclasses, mailcap, and readline, all of which are present in Python 3.7 through 3.12; the vulnerable behavior was removed in Python 3.13, but the affected fickling versions remain impacted for those Python releases.

Risk and Exploitability

The flaw carries a CVSS score of 8.8, indicating high severity, and while the EPSS score is not disclosed, the absence of a KEV listing does not diminish the risk. The attack vector is straightforward: any application that deserializes user-supplied data with fickling.load() can trigger the flawed safety gate, resulting in arbitrary code execution with the privileges of the running process. Because the vulnerability stems from incorrectly inferring safety based on module origin, it can be exploited without the need to bypass traditional authentication or privilege boundaries.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to the latest release of fickling that incorporates commit d011709 and adds the vulnerable modules to the UNSAFE_IMPORTS list.
  • If an upgrade is not feasible, avoid using fickling.load() on untrusted data; instead, employ a secure deserialization mechanism that does not rely on the faulty safety check.
  • Configuring your environment to ensure that standard library modules such as dataclasses, mailcap, and readline are not whitelisted—by reviewing and tightening the UNSAFE_IMPORTS list—will block the exploitation path until a patch can be applied.

Generated by OpenCVE AI on October 30, 2026 at 22:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Trailofbits
Trailofbits fickling
Vendors & Products Trailofbits
Trailofbits fickling
Type Values Removed Values Added
Description In Trail of Bits fickling through 0.1.12, the _process_import() method in fickle.py adds an imported name to the likely_safe_imports set whenever the source module is present in sys.stdlib_module_names and the name is absent from the UNSAFE_IMPORTS denylist, without inspecting what the name resolves to or how it behaves. The OvertlyBadEvals analysis pass in analysis.py then unconditionally skips any call whose function name appears in likely_safe_imports, including calls that would otherwise be flagged as overtly dangerous. As a result, any callable reachable through a non-blocked standard library module inherits module-level trust regardless of its own behavior, and check_safety() returns LIKELY_SAFE with zero findings for pickle payloads that reach code execution or file write through such callables. Demonstrated primitives: dataclasses._create_fn, which passes an attacker-controlled function body to exec() and yields arbitrary code execution on Python 3.7 through 3.12 (the internal _create_fn function was removed in Python 3.13); mailcap.findmatch, which internally calls os.system() on a test command taken from an attacker-controlled caps dictionary, yielding arbitrary code execution on Python versions through 3.12 (the mailcap module was removed in Python 3.13); and readline.add_history() followed by readline.write_history_file(), which writes attacker-controlled content to an arbitrary filesystem path (POSIX platforms, where the readline module is available). fickling.load() chains check_safety() into pickle.loads() as an explicit security gate, so a LIKELY_SAFE verdict causes the payload to be deserialized and executed with the privileges of the victim process. The root cause is the inference of callable safety from module origin; it is independent of, and separately fixable from, the dotted __qualname__ resolution weakness tracked as CVE-2026-118938, which this advisory does not address. As of 2026-10-30 the three demonstrated modules were added to UNSAFE_IMPORTS on the vendor master branch (commit d011709) pending release; released versions through 0.1.12 remain affected, and the module-origin trust root cause persists, as demonstrated by the related CVE-2026-118938 remaining exploitable on that same build.
Title Fickling check_safety() bypass: likely_safe_imports grants module-origin trust to unvalidated standard library callables
Weaknesses CWE-502
CWE-693
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-502

    Deserialization of Untrusted Data

  • CWE-693

    Protection Mechanism Failure

Sources

Status
PUBLISHED
Assigner
BombadilSystems
Published
Updated
Nov 6, 2026, 4:01 PM
Reserved
Jul 23, 2026, 2:00 PM
Status
Awaiting Analysis
Published
Oct 30, 2026, 10:16 PM
Modified
Nov 6, 2026, 4:17 PM
Severity
Important
Public date
Oct 30, 2026, 9:16 PM