{"id":"CVE-2026-95168","kind":"vulnerability","aliases":["CVE-2026-95168"],"related":[],"title":"thefuck: local attacker runs arbitrary code through rule loading","description":"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","summary":"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.","severity":"high","cvss":7.8,"epss":null,"exploited":false,"exploited_at":null,"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"],"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.\n- 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.\n- 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.","status":"open","published_at":"2026-10-20T15:17:37+00:00","first_seen_at":"2026-10-23T21:57:20+00:00","triaged_at":"2026-10-25T03:10:06+00:00","updated_at":"2026-10-25T03:28:04+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-25T03:10:06Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"local","title":"thefuck: local attacker runs arbitrary code through rule loading","impact":"high","summary":"thefuck 3.32 loads correction rules from paths through get_rules_import_paths and Rule.from_path without proper checks. A local attacker who can place a crafted rule file where thefuck looks for it can get code run as the user who runs thefuck.","category":"package","nicknames":[],"who_cares":["python","thefuck","developer-workstation","shared-hosts"],"confidence":0.5,"needs_auth":"yes","worst_case":"Code runs as the user who launches thefuck","analyst_note":"Check the NVD page and the upstream thefuck repository for a fixed version and the exact writable path conditions.","how_to_check":"- `pip show thefuck` to read the installed version and confirm it is `3.32`\n- Check whether user rule directories such as `~/.config/thefuck/rules` or the Python path entries thefuck scans contain files that the user did not write","needs_analyst":true,"not_affected_if":["thefuck-not-installed","different-version","no-untrusted-local-users"],"who_is_affected":"Only systems where thefuck 3.32 is installed and a local user, or a process that can write into the rule search paths, could plant a file. Shared machines and workstations with writable Python or config directories carry the most risk. Machines without thefuck, or with a different version, are not affected by this entry.","user_interaction":"unknown","needs_special_setup":"unknown","severity_if_unknown":"high"},"cost_usd":0.000593,"input_tokens":3299,"output_tokens":527,"severity_before":"high"},"analyst_status":"done","analyst_note":"Check the NVD page and the upstream thefuck repository for a fixed version and the exact writable path conditions.","search":"'-2026':11A,14A '-95168':12A,15A '/rules':39B '3.32':27B 'allow':92C 'anoth':67B 'anyon':57B 'arbitrari':5A,98C 'attack':3A,95C 'check':56B 'code':6A,72B,99C 'contrib':38B 'current':29B 'cve':10A,13A 'develop':18B 'developer-workst':17B 'dir':49B 'enabl':55B 'entri':44B,64B 'everi':32B 'execut':31B,97C 'fix':83B 'found':35B 'get':71B,102C 'host':24B 'import':104C 'interpret':70B 'issu':87C 'load':9A,51B 'local':2A,94C 'master':30B 'modul':34B 'nvbn':89C 'packag':20B 'path':105C,110C 'plus':45B 'python':21B 'releas':85B 'rule':8A,33B,48B,54B,103C 'rule.from':109C 'run':4A,73B,79B 'share':23B 'shared-host':22B 'sys.path':43B,63B 'thefuck':1A,16A,25B,26B,37B,80B,90C 'thefuck/corrector.py':107C 'thefuck/types.py':112C 'time':52B 'upstream':82B 'use':65B 'user':47B,68B,76B 'v.3.32':91C 'via':100C 'whenev':77B 'workstat':19B 'writabl':42B 'write':60B","nicknames":[],"mitigations":[],"who_affected":"Systems with thefuck installed where a lower-privileged local user can write into a sys.path entry (shared virtualenv, group-writable site-packages) or into the user's thefuck rules directory. Shared multi-user machines and shared dev boxes are the real exposure. On single-user machines it reduces to ordinary package-integrity trust, so you can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-20T15:17:37+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","cvss_by":"134c704f-9b21-4f2e-91b3-4a467353bcc0","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-95168","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-95168","severity":null,"published_at":"2026-10-20T15:17:37+00:00","modified_at":"2026-10-21T20:17:28+00:00","first_seen_at":"2026-10-23T21:57:20+00:00","fetched_at":"2026-10-23T22:28:58+00:00","note":null},{"source":"analyst","external_id":"CVE-2026-95168:723","url":null,"severity":null,"published_at":"2026-10-25T03:28:04+00:00","modified_at":"2026-10-25T03:28:04+00:00","first_seen_at":"2026-10-25T03:28:04+00:00","fetched_at":"2026-10-25T03:28:04+00:00","note":"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":[{"id":3182,"url":"https://github.com/nvbn/thefuck/issues/1623","title":"thefuck_contrib_* packages are exec'd before enable-gating on every run (issue #1623)","kind":"issue","source":"analyst","text":null,"published_at":null,"relation":"describes","confidence":null,"note":null},{"id":3185,"url":"https://security-tracker.debian.org/tracker/CVE-2026-95168","title":"Debian security tracker: CVE-2026-95168 (unfixed)","kind":"other","source":"analyst","text":null,"published_at":null,"relation":"mentions","confidence":null,"note":null},{"id":3187,"url":"https://github.com/nvbn/thefuck/releases","title":"thefuck releases (latest 3.32)","kind":"release","source":"analyst","text":null,"published_at":null,"relation":"mentions","confidence":null,"note":null}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}