---
id: "CVE-2026-95168"
kind: "vulnerability"
aliases: ["CVE-2026-95168"]
title: "thefuck: local attacker runs arbitrary code through rule loading"
severity: "high"
cvss: 7.8
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "thefuck", "fixed": [], "affected": "<= 3.32", "ecosystem": "pypi"}]
ecosystems: []
tags: ["developer-workstation", "package", "python", "shared-hosts", "thefuck"]
not_affected_if: ["different-version", "no-untrusted-local-users", "no-writable-sys-path", "single-user-machine", "thefuck-not-installed"]
published_at: "2026-10-20T15:17:37+00:00"
first_seen_at: "2026-10-23T21:57:20+00:00"
updated_at: "2026-10-25T03:28:04+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-95168", "first_seen_at": "2026-10-23T21:57:20+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-10-25T03:28:04+00:00"}]
---

# thefuck: local attacker runs arbitrary code through rule loading

thefuck 3.32 (and current master) executes every rule module found in thefuck_contrib_*/rules on any writable sys.path entry, plus the user rules dir, at load time, before rule enable checks. Anyone who can write to a sys.path entry used by another user's interpreter gets code run as that user whenever they run thefuck. No upstream fix is released.

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

## Affected

- pypi:thefuck affected <= 3.32 fixed ?

## How to check

- `pip show thefuck` (or `thefuck --version`): 3.32 and earlier with rule loading from sys.path is affected; no fixed version exists.
- List planted packages: `python -c "import sys,glob;[print(p) for d in sys.path for p in glob.glob(d+'/thefuck_contrib_*')]"` and review any you did not install.
- Check ~/.config/thefuck/rules for files you did not write, and whether any sys.path entry (shared venv, site-packages) is group- or world-writable.

## Fix

unknown: no fixed release; 3.32 is the latest release and upstream issue #1623 is open. Workaround: make sure no sys.path directory is writable by other users, remove unexpected thefuck_contrib_* packages, or uninstall thefuck on shared hosts. Watch the repo for a release.

## Timeline

- 2026-10-23T21:57:20+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-95168
- 2026-10-25T03:28:04+00:00 analyst — Root cause confirmed in upstream issue #1623 and master corrector.py: every sys.path entry is globbed for thefuck_contrib_*/rules and each module is executed on load, before enable gating. No fixed release (latest 3.32; Debian lists unfixed, minor issue). Not exploited; no PoC link found. NVD page had no content.

## Documents

- [describes] thefuck_contrib_* packages are exec'd before enable-gating on every run (issue #1623) https://github.com/nvbn/thefuck/issues/1623
- [mentions] Debian security tracker: CVE-2026-95168 (unfixed) https://security-tracker.debian.org/tracker/CVE-2026-95168
- [mentions] thefuck releases (latest 3.32) https://github.com/nvbn/thefuck/releases

## From the sources

An issue in nvbn thefuck v.3.32 allows a local attacker to execute arbitrary code via the get_rules_import_paths in thefuck/corrector.py and Rule.from_path in thefuck/types.py

---

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