CVE-2022-20001
Injection in fish
Reported by github_m · Published March 14, 2022
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.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| fish-shell | fish-shell | >= 3.1.0, < 3.4.0 |
| fish-shell | fish-shell | 3.1.0 |
| alpine | fish | 0 |
Timeline
- Mar 14, 2022 CVE Published
- Mar 15, 2022 EPSS Score (30 in total, the first dated here)
- Apr 23, 2025 CVE Updated
- Mar 10, 2026 Distribution Patch
- Mar 10, 2026 Security Advisory (3 in total, the first dated here)
- Jul 10, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-20001
vulnetix vdb fixes CVE-2022-20001
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-20001/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- FEDORA-2022-443c5ec2dd vendor-advisory
- FEDORA-2022-cd2c5e0634 vendor-advisory
- DSA-5234 vendor-advisory
- GLSA-202309-10 vendor-advisory