CVE-2026-50187: Oh My Zsh: Arbitrary Code Execution in oh-my-zsh dotenv plugin via malicious .env files

Published Aug 18, 2026
·
Updated

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 ZSHDOTENVFILE 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 ZSHDOTENVPROMPT=false or after the default prompt accepts an empty Enter response. This issue is fixed in versions released after 2026-05-28.

Affected Software

1 affected component
Oh My Zsh<2026-05-28

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade oh-my-zsh/plugins/dotenv/dotenv.plugin.zsh (dotenv plugin) to a version that resolves this vulnerability.

    Fixed in after 2026-05-28

Event History

Aug 18, 2026
CVE Published
via MITRE·03:09 PM
Data Sourced
via MITRE·03:09 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is realistically exposed to this issue?

Users of the Oh My Zsh dotenv plugin are exposed when they change into a directory containing a malicious .env file. The commands run with the privileges of the account running Zsh.

2

What does an attacker need to exploit it?

An attacker needs to place or induce a user to enter a directory containing a .env file with syntactically valid shell commands. Exploitation requires user interaction in the form of changing into that directory; no existing account privileges are required.

3

Is a non-default configuration required for unprompted execution?

The default prompt behavior can still lead to execution if the user accepts the prompt with an empty Enter response. Execution occurs without a prompt when ZSH_DOTENV_PROMPT is set to false.

4

What should be done if patching cannot happen immediately?

Update to an Oh My Zsh version released after 2026-05-28. Until then, avoid entering untrusted directories that may contain .env files and do not disable the dotenv prompt.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203