CVE-2021-3726OS Command Injection in ohmyzsh/ohmyzsh
- 7.5HighCVSS base score
- 0.81%Exploitation in 30 daysEPSS · top 43% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
# Vulnerability in `title` function **Description**: the `title` function defined in `lib/termsupport.zsh` uses `print` to set the terminal title to a user-supplied string. In Oh My Zsh, this function is always used securely, but custom user code could use the `title` function in a way that is unsafe. **Fixed in**: [a263cdac](https://github.com/ohmyzsh/ohmyzsh/commit/a263cdac). **Impacted areas**: - `title` function in `lib/termsupport.zsh`. - Custom user code using the `title` function.
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 | Critical9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 0.81% · top 43% of all CVEs (12 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 – < a263cdac
What to do
Exploitation: **Exploit PoC**: 1. Install Oh My Zsh. 2. Add a custom function that calls `title` to set the terminal title with a user-supplied string. For example: ```sh function dirpath_in_title { title "$PWD" } add-zsh-hook precmd dirpath_in_title ``` 3. Create and cd into a directory with a subshell command as its name: ```sh baddir='`echo pwned && id`' mkdir "$baddir" && cd "$baddir" ``` 4. The `title` function incorrectly expands the subshell command (see screenshot): 
References
References1
- https://github.com/ohmyzsh/ohmyzsh/commit/a263cdac (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-27006 (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-3726)Record last updated .