Sceawere
Vulnerability Detail
CVE-2026-73505UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
Oh My Posh Path Segment Template Injection
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 7.8
- Creation Date
- 6h ago
- Vendor
- JanDeDobbeleer
- Product
- oh-my-posh
- Attack Type
- CWE-94: Improper Control of Generation of Code ('Code Injection')
- Vector String
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Complexity
- LOW
Narrative and Response
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.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "7.8",
"pubDate": "2026-08-13T15:20:16.943Z",
"pubdate": "2026-08-13T15:20:16.943Z",
"executiveSummary": "A template injection vulnerability exists in Oh My Posh prior to version 29.35.1, specifically within the path segment rendering logic. The vulnerability arises from the improper handling of raw folder names passed to the template rendering engine.\nAn attacker who controls directory names within the file system can supply crafted Go template expressions. When the affected prompt renderer evaluates these directory names during prompt rendering, it leads to arbitrary operating system command execution.\nThe impact of this vulnerability is critical, allowing remote or local attackers to execute arbitrary OS commands in the security context of the current user running the shell prompt.\nThe affected product is Oh My Posh in versions prior to 29.35.1. Exploitation requires the victim to navigate into or operate within a directory containing a maliciously crafted folder name that triggers the evaluation of the exposed command execution capabilities within the template function map.",
"technicalDetails": "The root cause of the vulnerability resides in the src/segments/path.go file of Oh My Posh, specifically within the setStyle() function. Prior to version 29.35.1, this function passed pt.Path, which contains raw, unescaped folder names, directly to the template.Render function.\nThe vulnerable component is the template rendering mechanism exposed by Oh My Posh, whose function map includes the cmd function. Because untrusted directory names are treated as template syntax rather than literal string values, embedded Go template directives are parsed and evaluated.\nThe attack flow proceeds as follows: 1) An attacker creates a directory with a name containing a malicious Go template expression leveraging the exposed cmd function. 2) The victim uses Oh My Posh as their shell prompt renderer. 3) The victim navigates into the malicious directory or any of its descendant directories. 4) Oh My Posh evaluates the path segment during prompt rendering, passing the raw folder name to template.Render. 5) The template engine parses the embedded expression, invoking the cmd function and executing arbitrary operating system commands.\nThe vulnerability requires no authentication or network exposure, as it triggers locally based on file system contents. However, it requires the attacker to influence directory names accessible to the victim, or rely on the victim cloning a repository or extracting an archive containing the malicious folder structure. The execution privilege level is strictly bound to the user running the shell prompt."
}