Oh My Zsh: Arbitrary Code Execution in oh-my-zsh dotenv plugin via malicious .env files
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
- Fix · CNA ohmyzsh (ohmyzsh) Fixed in 2026-05-28
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-50187
References
More ohmyzsh vulnerabilities
- TI-2021-02701 OS Command Injection in ohmyzsh/ohmyzsh CVSS 3.1CRITICAL 9.8
- TI-2021-02660 OS Command Injection in ohmyzsh/ohmyzsh CVSS 3.1CRITICAL 9.8
- TI-2021-02659 OS Command Injection in ohmyzsh/ohmyzsh CVSS 3.1CRITICAL 9.8
- TI-2021-02658 OS Command Injection in ohmyzsh/ohmyzsh CVSS 3.1HIGH 8.8
- TI-2021-02841 OS Command Injection in ohmyzsh/ohmyzsh CVSS 3.1HIGH 7.5
Sources
- CVE-2026-50187 · CVE Program
- CVE-2026-50187 · NVD
- FIRST EPSS
- CVE-2026-50187 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences