Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Oh My Posh: Arbitrary command execution via template injection in the path segment

0
High
Published: 07/24/2026 (07/24/2026, 22:36:11 UTC)
Source: GCVE Database
Product: github.com/jandedobbeleer/oh-my-posh

Description

Oh My Posh versions prior to 29.35.1 are vulnerable to arbitrary command execution via template injection in the path segment. The vulnerability arises because the resolved path string, which includes raw folder names from the filesystem, is re-rendered through the Go text/template engine that exposes a cmd function capable of running OS commands. If a directory name contains a Go template expression, it is evaluated when the prompt renders, allowing command execution as the current user. This affects the default configuration and multiple path styles. The issue is triggered by navigating into attacker-controlled directories and executing commands when the prompt renders.

CVSS v3.1

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

Goghsa
github.com/jandedobbeleer/oh-my-posh
Affected versions
<29.35.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/25/2026, 23:49:19 UTC

Technical Analysis

Oh My Posh re-renders the resolved path string containing raw folder names through the Go text/template engine, which exposes a cmd function that executes arbitrary OS commands. Since folder names are inserted verbatim and then parsed as templates, any Go template syntax in a directory name is evaluated during prompt rendering. This leads to arbitrary command execution as the current user when the shell is inside or below such a directory. The vulnerability affects all path styles including the default configuration and is exploitable by placing crafted directory names in cloned repositories, archives, network shares, or removable drives. The vulnerability is present in versions prior to 29.35.1.

Potential Impact

An attacker can achieve arbitrary command execution with the privileges of the user running Oh My Posh by creating or controlling directory names containing malicious Go template expressions. This execution occurs when the shell prompt renders after changing into or being within such directories. The impact includes full compromise of the user's environment, data, and potentially further system access depending on user privileges. The vulnerability affects multiple path styles and the default configuration, making it broadly exploitable in affected versions.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Suggested fixes include avoiding re-parsing the composed path as a template after inserting untrusted folder names, rendering configuration templates individually before concatenation, escaping template delimiters in folder names, or using a restricted function map without command execution capabilities for path rendering. Until a patch is available, avoid navigating into directories with untrusted or attacker-controlled names that may contain template expressions.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-6xj8-qv9j-xcjq
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["Go"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a6542199c2644c7f8087e37

Added to database: 07/25/2026, 23:09:13 UTC

Last enriched: 07/25/2026, 23:49:19 UTC

Last updated: 07/26/2026, 03:58:56 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses