{"id":"CVE-2022-20001","aliases":["ALPINE-CVE-2022-20001","DEBIAN-CVE-2022-20001","DSA-5234-1","EUVD-2022-25261","GHSA-pj5f-6vxj-f5mq","MGASA-2022-0181","OESA-2022-1689","UBUNTU-CVE-2022-20001","USN-5367-1","openSUSE-SU-2022:0096-1","openSUSE-SU-2024:11936-1"],"status":"published","title":"Injection in fish","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.","severity":{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.01484,"percentile":0.74188,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-427","CWE-74"],"published":"2022-03-14T00:00:00Z","modified":"2026-10-28T02:30:45Z","fixes":[{"ecosystem":"Alpine:v3.16","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.17","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.18","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.19","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.20","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.21","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.22","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.23","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"fish","fixed_in":["3.4.0-r0"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"fish","fixed_in":["3.4.0+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"fish","fixed_in":["3.4.0+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"fish","fixed_in":["3.4.0+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:11","package":"fish","fixed_in":["3.1.2-3+deb11u1"],"sources":["osv"]},{"ecosystem":"Mageia:8","package":"fish","fixed_in":["3.4.1-1.mga8"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP1","package":"fish","fixed_in":["3.3.1-2.oe1"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP3","package":"fish","fixed_in":["3.3.1-2.oe1"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS","package":"fish","fixed_in":["3.3.1-4.oe2203"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:20.04:LTS","package":"fish","fixed_in":["3.1.0-1.2ubuntu0.1~esm1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:22.04:LTS","package":"fish","fixed_in":["3.3.1+ds-3ubuntu0.1~esm1"],"sources":["osv"]},{"ecosystem":"SUSE:Package Hub 15 SP3","package":"fish3","fixed_in":["3.3.1-bp153.2.10.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.3","package":"fish3","fixed_in":["3.3.1-bp153.2.10.1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Alpine:v3.16","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.17","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.18","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.19","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.20","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.21","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.22","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.4.0-r0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.0+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.0+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.0+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:11","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.2-3+deb11u1"}]}],"versions":["3.1.2-3"]},{"source":"osv","ecosystem":"Mageia:8","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.1-1.mga8"}]}]},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP1","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1-2.oe1"}]}]},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP3","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1-2.oe1"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1-4.oe2203"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-1.2ubuntu0.1~esm1"}]}],"versions":["3.0.2-2","3.1.0-1","3.1.0-1.1","3.1.0-1.2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1+ds-3ubuntu0.1~esm1"}]}],"versions":["3.1.2-3ubuntu1","3.3.1+ds-2","3.3.1+ds-3"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-1.2ubuntu0.1~esm1"}]}],"versions":["3.0.2-2","3.1.0-1","3.1.0-1.1","3.1.0-1.2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"fish","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1+ds-3ubuntu0.1~esm1"}]}],"versions":["3.1.2-3ubuntu1","3.3.1+ds-2","3.3.1+ds-3"]},{"source":"osv","ecosystem":"SUSE:Package Hub 15 SP3","package":"fish3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1-bp153.2.10.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.3","package":"fish3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1-bp153.2.10.1"}]}]}],"products":[{"vendor":"debian","product":"debian_linux"},{"vendor":"fedoraproject","product":"fedora"},{"vendor":"fish-shell","product":"fish-shell"},{"vendor":"fishshell","product":"fish"}],"references":[{"url":"https://github.com/fish-shell/fish-shell/security/advisories/GHSA-pj5f-6vxj-f5mq","tags":["x_transferred","Third Party Advisory","advisory","report"]},{"url":"https://github.com/fish-shell/fish-shell/pull/8589","tags":["x_transferred","Patch","Third Party Advisory","fix","report"]},{"url":"https://github.com/fish-shell/fish-shell/releases/tag/3.4.0","tags":["x_transferred","Release Notes","Third Party Advisory","web","report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRNMYS2LKB6TKOOBQQRSRQICDMWLZ4QL/","tags":["vendor-advisory","x_transferred","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BPZ7JV22DSZB5LNUCUEJ2HO3PKM2TVVK/","tags":["vendor-advisory","x_transferred","advisory"]},{"url":"https://www.debian.org/security/2022/dsa-5234","tags":["vendor-advisory","x_transferred","Third Party Advisory","advisory"]},{"url":"https://security.gentoo.org/glsa/202309-10","tags":["vendor-advisory","x_transferred","advisory"]},{"url":"https://security.alpinelinux.org/vuln/CVE-2022-20001","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/20xxx/CVE-2022-20001.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-20001","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-20001","tags":["advisory"]},{"url":"https://advisories.mageia.org/MGASA-2022-0181.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=30227","tags":["report"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/SRNZU5M6WR5TPTNDAIMOYXCJP2ONI4FB/","tags":["web","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/TRNMYS2LKB6TKOOBQQRSRQICDMWLZ4QL/","tags":["web"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2022-1689","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-20001","tags":["report"]},{"url":"https://github.com/fish-shell/fish-shell/commit/37625053d424c1ab88de2b0c50c7fe71e1468e2c","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-5367-1","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-20001","tags":["report"]},{"url":"https://bugzilla.suse.com/1197139","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2022-20001","tags":["web"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2022-20001","title":"Injection in fish","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.","status":"published","published":"2022-03-14T00:00:00Z","modified":"2025-04-23T18:54:25.7Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T14:34:24.971323Z"}],"euvd":[{"id":"EUVD-2022-25261","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.","status":"published","published":"2022-03-14T00:00:00Z","modified":"2025-04-23T18:54:25Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T20:52:07.453218Z"}],"nvd":[{"id":"CVE-2022-20001","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.","status":"published","published":"2022-03-14T19:15:11.997Z","modified":"2026-06-17T04:23:29.84Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-74","CWE-427"],"updated_at":"2026-11-02T14:07:13.7085Z"}],"osv":[{"id":"ALPINE-CVE-2022-20001","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.","status":"published","published":"2022-03-14T19:15:11.997Z","modified":"2026-11-03T07:18:33.067580949Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T07:51:12.284675Z"},{"id":"CVE-2022-20001","title":"Injection in fish","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.","status":"published","published":"2022-03-14T00:00:00Z","modified":"2026-10-28T02:30:45.237068016Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T15:44:23.655778Z"},{"id":"DEBIAN-CVE-2022-20001","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.","status":"published","published":"2022-03-14T19:15:11.997Z","modified":"2026-11-03T08:02:09.065815326Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T08:24:50.542442Z"},{"id":"OESA-2022-1689","title":"fish security update","description":"fish is a fully-equipped command line shell (like bash or zsh) that is smart and user-friendly. fish supports powerful features like syntax highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure.\r\n\r\nSecurity Fix(es):\r\n\r\nfish 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\u0026apos;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.(CVE-2022-20001)","status":"published","published":"2022-06-02T11:04:57Z","modified":"2026-08-18T01:16:39.577884218Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:39.528805Z"},{"id":"UBUNTU-CVE-2022-20001","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.","status":"published","published":"2022-03-14T19:15:00Z","modified":"2026-02-04T04:15:40.584946Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T16:53:52.391598Z"},{"id":"DSA-5234-1","title":"fish - security update","status":"published","published":"2022-09-21T00:00:00Z","modified":"2026-03-09T02:09:39.769748Z","updated_at":"2026-11-02T15:46:17.543497Z"},{"id":"MGASA-2022-0181","title":"Updated fish packages fix security vulnerability","description":"Arbitrary Code Execution. (CVE-2022-20001)\n","status":"published","published":"2022-05-15T10:06:40Z","modified":"2026-04-16T04:40:53.709303991Z","updated_at":"2026-11-02T15:49:41.849028Z"},{"id":"openSUSE-SU-2022:0096-1","title":"Security update for fish3","description":"\nThis update for fish3 fixes the following issues:\n\n- CVE-2022-20001: Navigating to a compromised git repository may lead to arbitrary code execution (bsc#1197139)\n","status":"published","published":"2022-03-31T08:02:53Z","modified":"2026-02-04T02:53:44.948434Z","updated_at":"2026-11-02T16:58:32.653274Z"},{"id":"openSUSE-SU-2024:11936-1","title":"fish-3.4.0-1.1 on GA media","description":"These are all security issues fixed in the fish-3.4.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T02:34:27.491652Z","updated_at":"2026-11-02T16:58:35.485255Z"},{"id":"USN-5367-1","title":"fish vulnerability","description":"Justin Steven discovered that fish was not properly filtering local\ngit configuration directives when running background git commands.\nA remote unauthenticated attacker could possibly use this issue to\nexecute arbitrary code.\n","status":"published","published":"2022-08-10T18:31:37Z","modified":"2026-04-27T16:07:28.928963Z","updated_at":"2026-11-02T16:58:15.683829Z"}]}}
