Every CVE Search/ Get API key

CVE-2018-0502

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled,...

9.8 CriticalFix available

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

2.49%Up 1.0 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 9.8

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
CVE-2018-0502
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV:N/AC:L/Au:N/C:P/I:P/A:P
Weakness
CWE-20
Updated
2026-11-02
CVE List No score

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
CVE-2018-0502
Updated
2026-11-02
EUVDEUVD-2018-1324 No score

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
EUVD-2018-1324
Updated
2026-11-03
GitHub AdvisoriesGHSA-m962-vg7f-29fx 9.8

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled,...

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
GHSA-m962-vg7f-29fx
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-20
Updated
2026-11-02
OSV 9.8

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
CVE-2018-0502
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2018-0502 9.8

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
DEBIAN-CVE-2018-0502
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 6 moreShow less
OSVUBUNTU-CVE-2018-0502 9.8

An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line.

Record
UBUNTU-CVE-2018-0502
CVSS 3.0
9.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2024:11543-1 No score

zsh-5.8-7.7 on GA media

These are all security issues fixed in the zsh-5.8-7.7 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11543-1
Updated
2026-11-02
OSVSUSE-SU-2018:2686-1 No score

Security update for zsh

This update for zsh to version 5.6 fixes the following security issues:

  • CVE-2018-0502: The beginning of a #! script file was mishandled, potentially leading to an execve call to a program named on the second line (bsc#1107296).
  • CVE-2018-13259: Shebang lines exceeding 64 characters were truncated, potentially leading to an execve call to a program name that is a substring of the intended one (bsc#1107294).
Record
SUSE-SU-2018:2686-1
Updated
2026-11-02
OSVSUSE-SU-2022:0161-1 No score

Security update for zsh

This update for zsh fixes the following issues:

  • CVE-2018-0502: Fixed execve call vulnerability to program named on the second line when the beginning of a #! script file was mishandled. (bsc#1107296, bsc#1107294)
  • CVE-2018-13259: Fixed execve call vulnerability to program name that is a substring of the intended one. (bsc#1107296, bsc#1107294)
Record
SUSE-SU-2022:0161-1
Updated
2026-11-02
OSVSUSE-SU-2022:14910-1 No score

Security update for zsh

This update for zsh fixes the following issues:

  • CVE-2019-20044: Fixed an insecure dropping of privileges when unsetting the PRIVILEGED option (bsc#1163882).
  • CVE-2018-13259: Fixed an unexpected truncation of long shebang lines (bsc#1107294).
  • CVE-2018-7549: Fixed a crash when an empty hash table (bsc#1082991).
  • CVE-2018-1083: Fixed a stack-based buffer overflow when using tab completion on directories with long names (bsc#1087026).
  • CVE-2018-1071: Fixed a stack-based buffer overflow when executing certain commands (bsc#1084656).
  • CVE-2018-0502: Fixed a mishandling of shebang lines (bsc#1107296).
  • CVE-2017-18206: Fixed a buffer overflow related to symlink processing (bsc#1083002).
  • CVE-2017-18205: Fixed an application crash when using cd with no arguments (bsc#1082998).
  • CVE-2016-10714: Fixed a potential application crash when handling maximum length paths (bsc#1083250).
  • CVE-2014-10072: Fixed a buffer overflow when scanning very long directory paths for symbolic links (bsc#1082975).
  • CVE-2014-10071: Fixed a buffer overflow when redirecting output to a long file descriptor (bsc#1082977).
  • CVE-2014-10070: Fixed a privilege escalation vulnerability via environment variables (bsc#1082885).
Record
SUSE-SU-2022:14910-1
Updated
2026-11-02
OSVUSN-3764-1 No score

zsh vulnerabilities

It was discovered that Zsh incorrectly handled certain scripts. An attacker could possibly use this issue to execute arbitrary code. (CVE-2018-0502, CVE-2018-13259)

Richard Maciel Costa discovered that Zsh incorrectly handled certain scripts. An attacker could possibly use this issue to execute arbitrary code. (CVE-2018-1100)

Record
USN-3764-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
zsh
Debian:12
before 5.6-1
5.6-1
zsh
Debian:13
before 5.6-1
5.6-1
zsh
Debian:14
before 5.6-1
5.6-1
zsh
Debian:9
before 5.3.1-4+deb9u1, plus listed versions
5.3.1-4
5.3.1-4+deb9u1
zsh
SUSE:Linux Enterprise Module for Basesystem 15
before 5.6-3.6.1
5.6-3.6.1
zsh
SUSE:HPE Helion OpenStack 8
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:OpenStack Cloud 8
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:OpenStack Cloud 9
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:OpenStack Cloud Crowbar 8
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:OpenStack Cloud Crowbar 9
before 5.0.5-6.12.2
5.0.5-6.12.2
Show 14 moreShow less
Affected packages
PackageAffectedFixed
zsh
SUSE:Linux Enterprise Server for SAP Applications 12 SP3
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server for SAP Applications 12 SP4
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server 12 SP2-BCL
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server 12 SP3-LTSS
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server 12 SP3-BCL
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server 12 SP4-LTSS
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server 12 SP5
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Server for SAP Applications 12 SP5
before 5.0.5-6.12.2
5.0.5-6.12.2
zsh
SUSE:Linux Enterprise Point of Sale 11 SP3
before 4.3.6-67.9.8.1
4.3.6-67.9.8.1
zsh
SUSE:Linux Enterprise Server 11 SP4-LTSS
before 4.3.6-67.9.8.1
4.3.6-67.9.8.1
zsh
Ubuntu:14.04:LTS
before 5.0.2-3ubuntu6.3, plus listed versions
5.0.2-3ubuntu65.0.2-3ubuntu6.15.0.2-3ubuntu6.2
5.0.2-3ubuntu6.3
zsh
Ubuntu:16.04:LTS
before 5.1.1-1ubuntu2.3, plus listed versions
5.1.1-1ubuntu15.1.1-1ubuntu25.1.1-1ubuntu2.15.1.1-1ubuntu2.2
5.1.1-1ubuntu2.3
zsh
Ubuntu:18.04:LTS
before 5.4.2-3ubuntu3.1, plus listed versions
5.2-5ubuntu15.4.2-3ubuntu15.4.2-3ubuntu25.4.2-3ubuntu3
5.4.2-3ubuntu3.1
zsh
openSUSE:Tumbleweed
before 5.8-7.7
5.8-7.7

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2018-0502 is a critical vulnerability (CVSS 9.8) in Zsh, published September 5, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.49%, the 84th percentile. Fixed in zsh 5.6-1.

References

Show 36 moreShow less
MoveEnter Open