CVE-2021-3725OS Command Injection in ohmyzsh/ohmyzsh
- 7.5HighCVSS base score
- 1.1%Exploitation in 30 daysEPSS · top 35% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
Vulnerability in dirhistory plugin Description: the widgets that go back and forward in the directory history, triggered by pressing Alt-Left and Alt-Right, use functions that unsafely execute eval on directory names. If you cd into a directory with a carefully-crafted name, then press Alt-Left, the system is subject to command injection. Impacted areas: - Functions pop_past and pop_future in dirhistory plugin.
Timeline
ID reserved
By @huntrdev
- 3 months later
· 3 months later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| @huntrdevCNA (assigner) | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVDNVD · Modified | 3.1 | High8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 1.1% · top 35% of all CVEs (13 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.
Affected products
- affected unspecified – < 06fc5fb
What to do
Exploitation: Exploit PoC: 1. Install Oh My Zsh. 2. Enable the dirhistory plugin. 3. Open a terminal and create and cd into a directory like so: baddir="directory';id;echo 'pwned" mkdir "$baddir" && cd "$baddir" 4. Press Alt-Left to go back to previous directory (in macOS, use Option-Left). 5. id and echo pwned are executed: $ <Alt-Left> uid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),... pwned
References
References1
- https://github.com/ohmyzsh/ohmyzsh/commit/06fc5fb (opens in a new tab)x_refsource_MISCx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-27005 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-3725)Record last updated .