Skip to content
OpenAdvisories
High · 7.8 CVE-2022-20001 EUVD-2022-25261

Injection in fish

Published Mar 14, 2022 · Updated Apr 23, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
fish-shell fish-shell >= 3.1.0, < 3.4.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 fish 3.4.0+ds-1 —
Debian 13 fish 3.4.0+ds-1 —
Debian 12 fish 3.4.0+ds-1 —
Debian 11 fish 3.1.2-3+deb11u1 DSA-5234-1
ReleasePackageFixed inAdvisory
Ubuntu Pro 22.04 LTS fish 3.3.1+ds-3ubuntu0.1~esm1 USN-5367-1
Ubuntu Pro 20.04 LTS fish 3.1.0-1.2ubuntu0.1~esm1 USN-5367-1
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP3 fish3 3.3.1-bp153.2.10.1 openSUSE-SU-2022:0096-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.3 fish3 3.3.1-bp153.2.10.1 openSUSE-SU-2022:0096-1
ReleasePackageFixed inAdvisory
Alpine v3.24 fish 3.4.0-r0 —
Alpine v3.23 fish 3.4.0-r0 —
Alpine v3.22 fish 3.4.0-r0 —
Alpine v3.21 fish 3.4.0-r0 —
Alpine v3.20 fish 3.4.0-r0 —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 fish 3.4.0-r0 —
Alpine v3.18 fish 3.4.0-r0 —
Alpine v3.17 fish 3.4.0-r0 —
Alpine v3.16 fish 3.4.0-r0 —

Advisories 3

References