CVE-2022-20001
Injection in fish
Mitigation
- Upgrade fish-shell to 3.4.0 or later.
Who should check
- Anyone running fish-shell >= 3.1.0, < 3.4.0
Vulnerability facts
- Affected
- fish-shell >= 3.1.0, < 3.4.0
- Fixed in
- fish-shell 3.4.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.63% chance of exploitation in 30 days (percentile 77, 2026-11-26)
- CWE
- CWE-74
- Modified
Description
fish is a command line shell. fish version 3.1.0 through version 3.3.1 is vulnerable to arbitrary code execution. git repositories can contain per-repository configuration that change the behavior of git, including running arbitrary commands. When using the default configuration of fish, changing to a directory automatically runs `git` commands in order to display information about the current repository in the prompt. If an attacker can convince a user to change their current directory into one controlled by the attacker, such as on a shared file system or extracted archive, fish will run arbitrary commands under the attacker's control. This problem has been fixed in fish 3.4.0. Note that running git in these directories, including using the git tab completion, remains a potential trigger for this issue. As a workaround, remove the `fish_git_prompt` function from the prompt.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| fish-shell | >= 3.1.0, < 3.4.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-20001. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-20001.md Affected: fish-shell >= 3.1.0, < 3.4.0 Fixed in: fish-shell 3.4.0 Steps: 1. Search this machine and project for fish-shell: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/fish-shell/fish-shell/security/advisories/GHSA-pj5f-6vxj-f5mq
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRNMYS2LKB6TKOOBQQRSRQICDMWLZ4QL/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BPZ7JV22DSZB5LNUCUEJ2HO3PKM2TVVK/
- https://www.debian.org/security/2022/dsa-5234
- https://security.gentoo.org/glsa/202309-10
FAQ
Is CVE-2022-20001 being exploited?
There is no confirmed exploitation: CVE-2022-20001 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.63% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-20001?
High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2022-20001?
fish-shell >= 3.1.0, < 3.4.0.
Is there a fix for CVE-2022-20001?
Yes. Fixed in fish-shell 3.4.0. Upgrade fish-shell to 3.4.0 or later.
How do I check if I'm affected by CVE-2022-20001?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.