GHSA-6xj8-qv9j-xcjq: Oh My Posh: Arbitrary command execution via template injection in the path segment
Oh My Posh re-renders the resolved path string, which contains the raw folder names taken from the filesystem, through the Go text/template engine. That engine’s function map exposes a cmd function that runs arbitrary OS commands. A directory whose name contains a Go template expression is therefore evaluated when the prompt renders, giving arbitrary command execution as the current user as soon as the shell is inside (or below) that directory. The built-in default configuration is affected.
References
- github.com/JanDeDobbeleer/oh-my-posh/commit/88ddbe0b0a4dd13cc345996108c9869493f2c690
- github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v29.35.1
- github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v29.36.0
- github.com/JanDeDobbeleer/oh-my-posh/security/advisories/GHSA-6xj8-qv9j-xcjq
- github.com/advisories/GHSA-6xj8-qv9j-xcjq
Code Behaviors & Features
Detect and mitigate GHSA-6xj8-qv9j-xcjq with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →