cve.bz

CVE-2026-50187 ohmyzsh ohmyzsh: Code Injection

8.8 highEPSS 0.5%

High (8.8) in ohmyzsh ohmyzsh. EPSS 0.5% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.5% (unchanged from 0.5% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 46th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-08-18. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-50187 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-50187?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-50187?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-50187 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ohmyzsh< 2026-05-28

Red Hat

Red Hat rates this Important.

Red Hat's statement

This is an Important arbitrary code execution flaw in the `dotenv` plugin of Oh My Zsh. The vulnerability allows an attacker to execute arbitrary shell commands with the user's privileges when a user navigates into a directory containing a specially crafted `.env` file.

Red Hat's mitigation

To mitigate this issue, disable the `dotenv` plugin in Oh My Zsh if it is not explicitly required. This can be achieved by removing `dotenv` from the `plugins` array in the `~/.zshrc` file. Alternatively, ensure that `ZSH_DOTENV_PROMPT` is not set to `false` to require explicit user confirmation before sourcing `.env` files, and exercise caution when changing directories into untrusted locations. After modifying `~/.zshrc`, restart the Zsh session for changes to take effect.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/ansible-devspaces-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-tech-preview/ansible-devspaces-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-50187.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON