{"id":"CVE-2018-0502","aliases":["DEBIAN-CVE-2018-0502","DLA-2470-1","EUVD-2018-1324","GHSA-m962-vg7f-29fx","SUSE-SU-2018:2686-1","SUSE-SU-2022:0161-1","SUSE-SU-2022:14910-1","UBUNTU-CVE-2018-0502","USN-3764-1","openSUSE-SU-2024:11543-1"],"status":"published","title":"An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled,...","description":"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.","severity":{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-07","score":0.02487,"percentile":0.84719,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-20"],"published":"2018-09-05T00:00:00Z","modified":"2026-10-24T10:30:16Z","fixes":[{"ecosystem":"Debian:12","package":"zsh","fixed_in":["5.6-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"zsh","fixed_in":["5.6-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"zsh","fixed_in":["5.6-1"],"sources":["osv"]},{"ecosystem":"Ubuntu:14.04:LTS","package":"zsh","fixed_in":["5.0.2-3ubuntu6.3"],"sources":["osv"]},{"ecosystem":"Ubuntu:16.04:LTS","package":"zsh","fixed_in":["5.1.1-1ubuntu2.3"],"sources":["osv"]},{"ecosystem":"Ubuntu:18.04:LTS","package":"zsh","fixed_in":["5.4.2-3ubuntu3.1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:12","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.6-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.6-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.6-1"}]}]},{"source":"osv","ecosystem":"Debian:9","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.3.1-4+deb9u1"}]}],"versions":["5.3.1-4"],"bundled":7},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Basesystem 15","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.6-3.6.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:HPE Helion OpenStack 8","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:OpenStack Cloud 8","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:OpenStack Cloud 9","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:OpenStack Cloud Crowbar 8","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:OpenStack Cloud Crowbar 9","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 12 SP3","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 12 SP4","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 12 SP2-BCL","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 12 SP3-LTSS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 12 SP3-BCL","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 12 SP4-LTSS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 12 SP5","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 12 SP5","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.5-6.12.2"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Point of Sale 11 SP3","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.3.6-67.9.8.1"}]}],"bundled":12},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 11 SP4-LTSS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.3.6-67.9.8.1"}]}],"bundled":12},{"source":"osv","ecosystem":"Ubuntu:14.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.2-3ubuntu6.3"}]}],"versions":["5.0.2-3ubuntu6","5.0.2-3ubuntu6.1","5.0.2-3ubuntu6.2"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.1.1-1ubuntu2.3"}]}],"versions":["5.1.1-1ubuntu1","5.1.1-1ubuntu2","5.1.1-1ubuntu2.1","5.1.1-1ubuntu2.2"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.2-3ubuntu3.1"}]}],"versions":["5.2-5ubuntu1","5.4.2-3ubuntu1","5.4.2-3ubuntu2","5.4.2-3ubuntu3"]},{"source":"osv","ecosystem":"Ubuntu:14.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.2-3ubuntu6.3"}]}],"versions":["5.0.2-3ubuntu6","5.0.2-3ubuntu6.1","5.0.2-3ubuntu6.2"],"bundled":3},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.1.1-1ubuntu2.3"}]}],"versions":["5.1.1-1ubuntu1","5.1.1-1ubuntu2","5.1.1-1ubuntu2.1","5.1.1-1ubuntu2.2"],"bundled":3},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.2-3ubuntu3.1"}]}],"versions":["5.2-5ubuntu1","5.4.2-3ubuntu1","5.4.2-3ubuntu2","5.4.2-3ubuntu3"],"bundled":3},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"zsh","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.8-7.7"}]}],"bundled":6}],"products":[{"vendor":"canonical","product":"ubuntu_linux"},{"vendor":"zsh","product":"zsh"}],"references":[{"url":"https://bugs.debian.org/908000","tags":["x_refsource_MISC","x_transferred","Mailing List","Patch","Third Party Advisory","fix"]},{"url":"https://sourceforge.net/p/zsh/code/ci/1c4c7b6a4d17294df028322b70c53803a402233d","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix"]},{"url":"https://www.zsh.org/mla/zsh-announce/136","tags":["x_refsource_MISC","x_transferred","Mailing List","Vendor Advisory","advisory"]},{"url":"https://usn.ubuntu.com/3764-1/","tags":["vendor-advisory","x_refsource_UBUNTU","x_transferred","Third Party Advisory","advisory"]},{"url":"https://security.gentoo.org/glsa/201903-02","tags":["vendor-advisory","x_refsource_GENTOO","x_transferred","Third Party Advisory","advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2020/12/msg00000.html","tags":["mailing-list","x_refsource_MLIST","x_transferred","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2018-0502"},{"url":"https://github.com/advisories/GHSA-m962-vg7f-29fx"},{"url":"https://security-tracker.debian.org/tracker/CVE-2018-0502","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2018/suse-su-20182686-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1107294","tags":["report"]},{"url":"https://bugzilla.suse.com/1107296","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2018-0502","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2018-13259","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2022/suse-su-20220161-1/","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2022/suse-su-202214910-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1082885","tags":["report"]},{"url":"https://bugzilla.suse.com/1082975","tags":["report"]},{"url":"https://bugzilla.suse.com/1082977","tags":["report"]},{"url":"https://bugzilla.suse.com/1082991","tags":["report"]},{"url":"https://bugzilla.suse.com/1082998","tags":["report"]},{"url":"https://bugzilla.suse.com/1083002","tags":["report"]},{"url":"https://bugzilla.suse.com/1083250","tags":["report"]},{"url":"https://bugzilla.suse.com/1084656","tags":["report"]},{"url":"https://bugzilla.suse.com/1087026","tags":["report"]},{"url":"https://bugzilla.suse.com/1163882","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2014-10070","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2014-10071","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2014-10072","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2016-10714","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2017-18205","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2017-18206","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2018-1071","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2018-1083","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2018-7549","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2019-20044","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2018-0502","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-3764-1","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2018-0502","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2018-1100","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2018-13259","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2018-1100","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2018-0502","description":"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.","status":"published","published":"2018-09-05T07:00:00Z","modified":"2024-08-05T03:28:11.019Z","updated_at":"2026-11-02T14:35:12.596526Z"}],"euvd":[{"id":"EUVD-2018-1324","description":"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.","status":"published","published":"2018-09-05T07:00:00Z","modified":"2024-08-05T03:28:11Z","updated_at":"2026-11-03T02:40:18.31448Z"}],"ghsa":[{"id":"GHSA-m962-vg7f-29fx","title":"An issue was discovered in zsh before 5.6. The beginning of a #! script file was mishandled,...","description":"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.","status":"published","published":"2022-05-13T01:13:20Z","modified":"2023-02-01T05:04:08Z","cvss":[{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:50:07.876412Z"}],"nvd":[{"id":"CVE-2018-0502","description":"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.","status":"published","published":"2018-09-05T08:29:00.23Z","modified":"2026-06-17T01:31:01.78Z","cvss":[{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:04:38.672108Z"}],"osv":[{"id":"CVE-2018-0502","description":"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.","status":"published","published":"2018-09-05T08:29:00.23Z","modified":"2026-10-24T10:30:16.243816842Z","cvss":[{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:07.192756Z"},{"id":"DEBIAN-CVE-2018-0502","description":"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.","status":"published","published":"2018-09-05T08:29:00.23Z","modified":"2026-10-23T18:02:55.800373942Z","cvss":[{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:45:29.988046Z"},{"id":"UBUNTU-CVE-2018-0502","description":"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.","status":"published","published":"2018-09-05T00:00:00Z","modified":"2026-04-22T11:38:36.483816Z","cvss":[{"version":"3.0","score":9.8,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:54:16.154988Z"},{"id":"DLA-2470-1","title":"zsh - security update","status":"published","published":"2020-11-30T00:00:00Z","modified":"2026-03-09T01:20:23.585073Z","updated_at":"2026-11-02T15:46:10.712745Z"},{"id":"openSUSE-SU-2024:11543-1","title":"zsh-5.8-7.7 on GA media","description":"These are all security issues fixed in the zsh-5.8-7.7 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T03:46:50.299155Z","updated_at":"2026-11-02T16:58:35.195147Z"},{"id":"SUSE-SU-2018:2686-1","title":"Security update for zsh","description":"This update for zsh to version 5.6 fixes the following security issues:\n\n- CVE-2018-0502: The beginning of a #! script file was mishandled, potentially\n  leading to an execve call to a program named on the second line (bsc#1107296).\n- CVE-2018-13259: Shebang lines exceeding 64 characters were truncated,\n  potentially leading to an execve call to a program name that is a substring of\n  the intended one (bsc#1107294).\n","status":"published","published":"2018-09-11T13:00:06Z","modified":"2026-02-04T02:23:36.48402Z","updated_at":"2026-11-02T15:53:45.378228Z"},{"id":"SUSE-SU-2022:0161-1","title":"Security update for zsh","description":"This update for zsh fixes the following issues:\n\n- 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)\n- CVE-2018-13259: Fixed execve call vulnerability to program name that is a substring of the intended one. (bsc#1107296, bsc#1107294)\n","status":"published","published":"2022-01-24T10:48:03Z","modified":"2026-02-04T02:28:16.104216Z","updated_at":"2026-11-02T15:53:50.066806Z"},{"id":"SUSE-SU-2022:14910-1","title":"Security update for zsh","description":"This update for zsh fixes the following issues:\n\n- CVE-2019-20044: Fixed an insecure dropping of privileges when unsetting\n  the PRIVILEGED option (bsc#1163882).\n- CVE-2018-13259: Fixed an unexpected truncation of long shebang lines (bsc#1107294).\n- CVE-2018-7549: Fixed a crash when an empty hash table (bsc#1082991).\n- CVE-2018-1083: Fixed a stack-based buffer overflow when using tab completion\n  on directories with long names (bsc#1087026).\n- CVE-2018-1071: Fixed a stack-based buffer overflow when executing certain\n  commands (bsc#1084656).\n- CVE-2018-0502: Fixed a mishandling of shebang lines (bsc#1107296).\n- CVE-2017-18206: Fixed a buffer overflow related to symlink processing (bsc#1083002).\n- CVE-2017-18205: Fixed an application crash when using cd with no\n  arguments (bsc#1082998).\n- CVE-2016-10714: Fixed a potential application crash when handling maximum\n  length paths (bsc#1083250).\n- CVE-2014-10072: Fixed a buffer overflow when scanning very long directory\n  paths for symbolic links (bsc#1082975).\n- CVE-2014-10071: Fixed a buffer overflow when redirecting output to a long\n  file descriptor (bsc#1082977).\n- CVE-2014-10070: Fixed a privilege escalation vulnerability via environment\n  variables (bsc#1082885).\n","status":"published","published":"2022-03-14T16:25:48Z","modified":"2026-02-04T02:44:38.670339Z","updated_at":"2026-11-02T15:53:50.513981Z"},{"id":"USN-3764-1","title":"zsh vulnerabilities","description":"It was discovered that Zsh incorrectly handled certain scripts.\nAn attacker could possibly use this issue to execute arbitrary code.\n(CVE-2018-0502, CVE-2018-13259)\n\nRichard Maciel Costa discovered that Zsh incorrectly handled certain scripts.\nAn attacker could possibly use this issue to execute arbitrary code.\n(CVE-2018-1100)\n","status":"published","published":"2018-09-11T18:00:56Z","modified":"2026-04-22T09:49:33.657188Z","updated_at":"2026-11-02T16:58:14.019824Z"}]}}
