Oh My Zsh: Arbitrary Code Execution in oh-my-zsh dotenv plugin via malicious .env files
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-50187
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 08:35 UTC · Revision 1
Source evidence
Oh My Zsh: Arbitrary Code Execution in oh-my-zsh dotenv plugin via malicious .env files
core-osv · Original sourcePublished 18 Aug 2026, 15:09 UTC
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.
osv:CVE-2026-50187
Complete source record
{
"id": "9ab24aa13afb655f0449c49bdcafae9760bbcbd69c3165b4fdc468505844a652",
"url": "https://osv.dev/vulnerability/CVE-2026-50187",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Oh My Zsh: Arbitrary Code Execution in oh-my-zsh dotenv plugin via malicious .env files",
"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.",
"evidence": "osv:CVE-2026-50187",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2026-50187",
"aliases": [
"CVE-2026-50187",
"GHSA-3rgh-p3mg-rjqg"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/ohmyzsh/ohmyzsh",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "d170d18746bb06db7b2fc97b67e281597a3fc152"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"fixed": "d170d18746bb06db7b2fc97b67e281597a3fc152"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-50187.json"
}
}
],
"modified": "2026-10-28T02:30:27.287895839Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50187.json",
"https://github.com/ohmyzsh/ohmyzsh/security/advisories/GHSA-3rgh-p3mg-rjqg",
"https://nvd.nist.gov/vuln/detail/CVE-2026-50187",
"https://github.com/ohmyzsh/ohmyzsh/commit/d170d18746bb06db7b2fc97b67e281597a3fc152",
"https://github.com/ohmyzsh/ohmyzsh/pull/13778"
],
"provider_metadata": {
"cwe_ids": [
"CWE-94"
],
"cna_assigner": "GitHub_M",
"unresolved_ranges": [
{
"extracted_events": [
{
"range": [
{
"fixed": "2026-05-28"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
}
]
},
{
"extracted_events": [
{
"range": [
{
"fixed": "2026-05-28"
}
],
"source": "DESCRIPTION"
}
]
}
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50187.json"
}
},
"related_cves": [
{
"value": "CVE-2026-50187",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 493864,
"published_at": "2026-08-18T15:09:51.956+00:00"
}