JanDeDobbeleer oh-my-posh
Oh My Posh: Arbitrary command execution via template injection in the path segment
Oh My Posh is the most customisable and low-latency cross platform/shell prompt renderer. Prior to 29.35.1, the setStyle() function in src/segments/path.go passed pt.Path, which includes raw folder names, to template.Render, whose function map exposes cmd, so an attacker-controlled directory name containing a Go template expression could execute arbitrary operating system commands as the current user whenever the prompt rendered inside that directory or a descendant. This issue is fixed in version 29.35.1.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS7.8high · scored by CNA · CWE-94
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
JanDeDobbeleer oh-my-posh
- < 29.35.1
Fixed in 29.35.1
Mitigation
Upgrade oh-my-posh to 29.35.1 or later.
References
- Vendor advisory github.com/JanDeDobbeleer/oh-my-posh/security/…
- Patch github.com/JanDeDobbeleer/oh-my-posh/pull/7711
- Patch github.com/JanDeDobbeleer/oh-my-posh/commit/88…
1 more
- Release notes github.com/JanDeDobbeleer/oh-my-posh/releases/…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.