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.
Published: 2026-08-13
Score: 7.8 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a template injection in the path segment handling of Oh My Posh. The setStyle function forwards the raw folder name to the template renderer, which provides a cmd function that can invoke operating system commands. An attacker who can create or control a directory name containing a Go template expression can cause the prompt to evaluate that expression each time it renders inside that directory or its descendants, thereby executing arbitrary OS commands as the current user. This results in full remote code execution, compromising confidentiality, integrity, and availability of the affected system.

Affected Systems

The affected product is Oh My Posh, maintained by JanDeDobbeleer. Versions older than 29.35.1 are vulnerable. The issue is fixed in release v29.35.1 and later.

Risk and Exploitability

The CVSS score of 7.8 indicates high severity. EPSS is not available, but the product is niche so exploit likelihood may be low. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires the attacker to supply a malicious directory name and for a user to render the prompt within that directory or its subdirectories; thus initial access may be achieved via social engineering, compromised credentials, or by placing the malicious path on a shared or network file system that the user mounts. Once the prompt renders, the attacker-controlled template can spawn any command with the user’s privileges.

Generated by OpenCVE AI on August 13, 2026 at 16:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Oh My Posh to v29.35.1 or newer to apply the vendor-provided fix.
  • If an upgrade is not immediately feasible, avoid navigating to or rendering prompts in directories with attacker-controlled names; especially prevent using shared or network mounts that may contain malicious folder names.
  • As a temporary mitigation, configure Oh My Posh to disable dynamic path rendering (e.g., use a static theme or omit the path segment) until the product can be updated.

Generated by OpenCVE AI on August 13, 2026 at 16:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-6xj8-qv9j-xcjq Oh My Posh: Arbitrary command execution via template injection in the path segment
History

Thu, 13 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 13 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
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.
Title Oh My Posh: Arbitrary command execution via template injection in the path segment
Weaknesses CWE-1336
CWE-94
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-13T15:18:34.824Z

Reserved: 2026-08-12T19:00:33.736Z

Link: CVE-2026-73505

cve-icon Vulnrichment

Updated: 2026-08-13T15:18:26.301Z

cve-icon NVD

Status : Received

Published: 2026-08-13T15:20:16.943

Modified: 2026-08-13T16:19:04.977

Link: CVE-2026-73505

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T16:30:03Z

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')