Injection in fish
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-427.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| fish-shell | fish-shell | 3.1.0 to before 3.4.0 | 3.4.0 | Patch available | CNA |
- fish-shell Vendorfish-shell Affected 3.1.0 to before 3.4.0 Fixed in 3.4.0 Patch available CNA
CPE configurations NVD · 4
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:fishshell:fish:*:*:*:*:*:*:*:* | 3.1.0 – 3.3.1 | Vulnerable | fish-shell |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* | 11.0 | Vulnerable | Debian |
- cpe:2.3:a:fishshell:fish:*:*:*:*:*:*:*:* Versions 3.1.0 – 3.3.1 Vulnerable ·fish-shell
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
Remediation
- Fix · CNA fish-shell (fish-shell) Fixed in 3.4.0
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2022-20001
References
More fish-shell Fish vulnerabilities
- TI-2014-02341 fish (aka fish-shell) 2.0.0 before 2.1.1 does not restrict access to the configuration… CVSS 3.1CRITICAL 9.8
- TI-2014-02578 fish before 2.1.1 allows local users to write to arbitrary files via a symlink attack on… CVSS 3.0HIGH 7.8
- TI-2014-03133 The funced function in fish (aka fish-shell) 1.23.0 before 2.1.1 does not properly create… CVSS 3.1HIGH 7.0
- TI-2014-02336 The psub function in fish (aka fish-shell) 1.16.0 before 2.1.1 does not properly create… CVSS 3.1HIGH 7.0
- TI-2023-26920 Command substitution output can trigger shell expansion in fish shell CVSS 3.1MEDIUM 6.6
- TI-2014-02335 fish (aka fish-shell) 1.16.0 before 2.1.1 does not properly check the credentials, which… CVSS 2.0MEDIUM 6.9
Sources
- CVE-2022-20001 · CVE Program
- CVE-2022-20001 · NVD
- FIRST EPSS
- CVE-2022-20001 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences