Description
In zsh before 5.8.1, an attacker can achieve code execution if they control a command output inside the prompt, as demonstrated by a %F argument. This occurs because of recursive PROMPT_SUBST expansion.
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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | zsh | 5.8.1-1 | — |
| Debian 13 | zsh | 5.8.1-1 | — |
| Debian 12 | zsh | 5.8.1-1 | — |
| Debian 11 | zsh | 5.8-6+deb11u1 | DSA-5078-1 |
| Debian 10 | zsh | 5.7.1-1+deb10u1 | DSA-5078-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 9 | zsh | 5.3.1-4+deb9u5 | DLA-2926-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | zsh | No fix yet | — |
| Ubuntu 20.04 LTS | zsh | 5.8-3ubuntu1.1 | USN-5325-1 |
| Ubuntu 18.04 LTS | zsh | 5.4.2-3ubuntu3.2 | USN-5325-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 16.04 LTS | zsh | 5.1.1-1ubuntu2.3+esm1 | USN-5325-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 8 | zsh +1 | 5.5.1-9.el8 | RHSA-2022:2120 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 8 | zsh +1 | 5.5.1-9.el8 | ALSA-2022:2120 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 8 | zsh | 5.5.1-9.el8 | RLSA-2022:2120 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP3 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLES 15 SP2 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLES 15 SP1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLES 15 | zsh | 5.6-3.11.1 | SUSE-SU-2022:0732-1 |
| SLES 12 SP5 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
Show 23 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP4 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLES 12 SP3 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLES 12 SP2 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLES for SAP 15 SP2 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLES for SAP 15 SP1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLES for SAP 15 | zsh | 5.6-3.11.1 | SUSE-SU-2022:0732-1 |
| SLES for SAP 12 SP5 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLES for SAP 12 SP4 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLES for SAP 12 SP3 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SLE Real Time 15 SP2 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLE HPC 15 SP2 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLE HPC 15 SP1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SLE HPC 15 | zsh | 5.6-3.11.1 | SUSE-SU-2022:0732-1 |
| SUSE OpenStack Cloud Crowbar 9 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SUSE OpenStack Cloud Crowbar 8 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SUSE OpenStack Cloud 9 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SUSE OpenStack Cloud 8 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SUSE Manager Server 4.1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SUSE Manager Retail Branch Server 4.1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SUSE Manager Proxy 4.1 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SUSE HPE Helion OpenStack 8 | zsh | 5.0.5-6.19.1 | SUSE-SU-2022:0733-1 |
| SUSE Enterprise Storage 7 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
| SUSE Enterprise Storage 6 | zsh | 5.6-7.5.1 | SUSE-SU-2022:0735-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | zsh | 5.8.1-1.1 | openSUSE-SU-2024:11959-1 |
| openSUSE Leap 15.3 | zsh | 5.6-7.5.1 | openSUSE-SU-2022:0735-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | zsh | 5.8.1-r0 | — |
| Alpine v3.23 | zsh | 5.8.1-r0 | — |
| Alpine v3.22 | zsh | 5.8.1-r0 | — |
| Alpine v3.21 | zsh | 5.8.1-r0 | — |
| Alpine v3.20 | zsh | 5.8.1-r0 | — |
Show 8 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | zsh | 5.8.1-r0 | — |
| Alpine v3.18 | zsh | 5.8.1-r0 | — |
| Alpine v3.17 | zsh | 5.8.1-r0 | — |
| Alpine v3.16 | zsh | 5.8.1-r0 | — |
| Alpine v3.15 | zsh | 5.8.1-r0 | — |
| Alpine v3.14 | zsh | 5.8.1-r0 | — |
| Alpine v3.13 | zsh | 5.8.1-r0 | — |
| Alpine v3.12 | zsh | 5.8.1-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | zsh +1 | 5.8.1-1.amzn2023.0.3 | ALAS2023-2023-035 |
| Amazon Linux 2 | zsh +1 | 5.8.1-1.amzn2.0.1 | ALAS2-2022-1757 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 2 (CBL-Mariner) | zsh | 5.9-1 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 8 | zsh +1 | 5.5.1-9.el8 | ELSA-2022-2120 |
Advisories 17
- ALSA-2022:2120 Moderate: zsh security update AlmaLinux Security Advisories · Oct 29, 2026
- RHSA-2022:2120 Red Hat Security Advisory: zsh security update Red Hat Security Advisories (RHSA) · Jun 26, 2026
- USN-5325-1 zsh vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- DSA-5078-1 zsh - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-2926-1 zsh - security update Debian Security (DSA / DLA) · Mar 9, 2026
- RLSA-2022:2120 Moderate: zsh security update Rocky Linux Security Advisories · Feb 5, 2026
- openSUSE-SU-2022:0735-1 Security update for zsh SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:0732-1 Security update for zsh SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:11959-1 zsh-5.8.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:0733-1 Security update for zsh SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2022:0735-1 Security update for zsh SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2022-1335 Xerox FreeFlow Print Server: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 6, 2025
- WID-SEC-2022-0795 zsh: Schwachstelle ermöglicht Codeausführung BSI CERT-Bund (WID) · Jun 30, 2024
- WID-SEC-2022-1057 Apple macOS: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jun 21, 2023
- ALAS2023-2023-035 Moderate: zsh security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Feb 22, 2023
- ELSA-2022-2120 Moderate: zsh security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · May 17, 2022
- ALAS2-2022-1757 Moderate: zsh security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Mar 4, 2022
References
- https://zsh.sourceforge.io/releases.html
- https://vuln.ryotak.me/advisories/63
- FEDORA-2022-adf0c6d196 vendor-advisory
- DSA-5078 vendor-advisory
- [debian-lts-announce] 20220218 [SECURITY] [DLA 2926-1] zsh security update mailing-list
- FEDORA-2022-0a06987c3c vendor-advisory
- https://support.apple.com/kb/HT213257
- https://support.apple.com/kb/HT213256
- https://support.apple.com/kb/HT213255
- 20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina mailing-list
- 20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6 mailing-list
- 20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4 mailing-list