CVE-2022-20001Injection in fish
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.
What to do
Fixed builds are available from Alpine, Debian: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | fish | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | fish | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | fish | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | fish | Fix pending | 3.3.1+ds-3ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-20001 |
| Ubuntu 20.04 | fish | Fix pending | 3.1.0-1.2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-20001 |
| Ubuntu 18.04 | fish | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | fish | Fix pending | ||
| Ubuntu 14.04 | fish | Fix pending | ||
| Debian 14 | fish | Fixed | 3.4.0+ds-1 | DEBIAN-CVE-2022-20001 |
| Debian 13 | fish | Fixed | 3.4.0+ds-1 | DEBIAN-CVE-2022-20001 |
| Debian 12 | fish | Fixed | 3.4.0+ds-1 | DEBIAN-CVE-2022-20001 |
| Alpine Linux 3.24 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.23 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.22 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.21 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.20 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.19 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.18 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.17 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
| Alpine Linux 3.16 | fish | Fixed | 3.4.0-r0 | ALPINE-CVE-2022-20001 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- fish-shell: affected: >= 3.1.0, < 3.4.0
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://www.debian.org/security/2022/dsa-5234 (vendor-advisory)
- https://security.gentoo.org/glsa/202309-10 (vendor-advisory)
References
- https://github.com/fish-shell/fish-shell/security/advisories/GHSA-pj5f-6vxj-f5mq
- https://github.com/fish-shell/fish-shell/pull/8589
- https://github.com/fish-shell/fish-shell/releases/tag/3.4.0
- 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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.