# CVE-2022-20001: Injection in fish

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 1.63% (percentile 77, 2026-11-26)
- **CWE:** CWE-74
- **Published:** 2022-03-14T00:00:00.000Z
- **Modified:** 2026-06-17T04:23:29.840Z

## Who should check

- Anyone running fish-shell \>= 3.1.0, \< 3.4.0

## 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

- fish-shell: \>= 3.1.0, \< 3.4.0 (cvelist)

## Mitigation

- Upgrade fish-shell to 3.4.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://github.com/fish-shell/fish-shell/security/advisories/GHSA-pj5f-6vxj-f5mq>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRNMYS2LKB6TKOOBQQRSRQICDMWLZ4QL/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BPZ7JV22DSZB5LNUCUEJ2HO3PKM2TVVK/>
- vendor: <https://www.debian.org/security/2022/dsa-5234>
- vendor: <https://security.gentoo.org/glsa/202309-10>
- patch: <https://github.com/fish-shell/fish-shell/pull/8589>
- other: <https://github.com/fish-shell/fish-shell/releases/tag/3.4.0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-20001>

HTML: <https://flawdb.com/CVE-2022-20001> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-20001>
