Oh My Posh: Arbitrary command execution via template injection in the path segment
JanDeDobbeleer oh-my-posh
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/jandedobbeleer/oh-my-posh Go |
|
|
Original description
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.