CVE-2026-73506: Oh My Posh Terminal Escape Sequence Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-fwjx-9p69-h25h
CVSS 6.1
CWE-150
Published
Advisory Summary

CVE-2026-73506 is a MODERATE (CVSS 6.1) terminal escape sequence injection vulnerability (CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences) affecting Oh My Posh libraries in the Go ecosystem. The issue involves terminal escape sequence injection via unsanitized prompt segment data. Remediation is available by upgrading affected packages to version 29.35.1.

CVE-2026-73506 at a Glance

CVE Identifier CVE-2026-73506
GHSA Identifier GHSA-fwjx-9p69-h25h
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences
Affected Product Oh My Posh
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-73506

To remediate this vulnerability, upgrade all affected Oh My Posh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/jandedobbeleer/oh-my-posh fixed: 29.35.1
Upgrade github.com/jandedobbeleer/oh-my-posh to 29.35.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/jandedobbeleer/oh-my-posh

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-73506, inspect your project dependencies for Oh My Posh:

inspect dependencies for github.com/jandedobbeleer/oh-my-posh

Analyze the terminal output to locate any version of Oh My Posh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 29.35.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences, where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component. In Oh My Posh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Oh My Posh renders dynamic, potentially attacker-controlled strings (the current directory name, Git commit metadata, environment variable values, command output) into the prompt without neutralizing raw terminal control characters. An attacker who controls one of these values can inject ANSI/OSC escape sequences that the victim's terminal executes on every prompt render. (This is separate from the path-segment command-execution report; it has a different root cause and fix.) ### Details `src/terminal/writer.go`, `write(s rune)`: the literal characters of rendered segment content are emitted to the output buffer, and the only neutralization is a lookup in `formats.EscapeSequences`, which per shell contains only the shell's prompt-length markers (`\` for bash, `%` for zsh, nothing for fish/pwsh/cmd/nu). Raw C0/C1 control bytes (ESC `0x1b`, BEL `0x07`, CSI, OSC) are written verbatim. Oh My Posh's own styling is emitted through separate paths (`writeEscapedAnsiString`, `writeColorise`, `builder.WriteString(formats.Hyperlink...)`), so any control rune reaching `write(s rune)` originates from rendered data. `trimAnsi` is already applied to the console title (`FormatTitle`) but not to the prompt body. ### Attacker-controlled sources (both verified) 1. Current directory name (default config, Linux/macOS). Directory names may contain any byte except `/` and NUL, including `0x1b`. The path segment renders the working directory in every theme. 2. Git commit subject / author / upstream URL (cross-platform, including Windows). `Git.Commit()` runs `git log -1 --pretty=format:...su:%s...` and exposes `.Commit.Subject`, `.Commit.Author.Name`/`.Email` and `.RawUpstreamURL`; Git imposes no restriction on these, so they can carry raw escape sequences. ### PoC Git commit-subject vector (config: a single git segment with template `{{ .Commit.Subject }}`): ``` printf 'feat: \033]0;HACKED\007\033]52;c;ZWNobyBQV05FRA==\007 update' > msg.txt git commit --allow-empty -F msg.txt oh-my-posh print primary --config poc.omp.json --shell fish | xxd ``` Output (excerpt) shows the attacker's OSC 0 (set title) and OSC 52 (clipboard write) passed through unmodified, wrapped only in Oh My Posh's colors: ``` ...255m feat: 1b5d 303b 4841 434b 4544 07 1b5d 3532 3b63 3b5a 574e ... 07 ... ESC ] 0 ; H A C K E D BEL ESC ] 5 2 ; c ; <base64> BEL ``` The directory-name vector reproduces identically via the path segment. ### Impact The terminal interprets the injected sequences on every render, enabling, per emulator: clipboard hijacking (OSC 52 write, so a command placed in the clipboard runs when the victim pastes), prompt/screen spoofing, window-title manipulation, and terminal denial of service. Delivery is remote (repo/archive/share); execution is local when the prompt renders after cd. Suggested fix: neutralize C0/C1 control characters in untrusted segment data before it reaches the terminal, at minimum the path segment (folder names) and the git segment (`Commit.Subject`, `Commit.Author.*`, `RawUpstreamURL`). `trimAnsi` already exists and is applied to the title; extending equivalent handling to segment data closes the gap. Filtering control runes in `write(s rune)` would also work as defense in depth (Oh My Posh's own styling never flows through that function), optionally behind an opt-out for users who deliberately embed escapes in their own templates.

CVE-2026-73506 Affected Oh My Posh Versions

1 component(s)
Fixed Versions:
29.35.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/jandedobbeleer/oh-my-posh
Go
< 29.35.1
29.35.1

References

Frequently Asked Questions

What is CVE-2026-73506?
CVE-2026-73506 is a security vulnerability in Oh My Posh involving Terminal escape sequence injection via unsanitized prompt segment data under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences.
Which Oh My Posh versions are affected?
Affected versions include releases prior to 29.35.1 across affected packages: github.com/jandedobbeleer/oh-my-posh.
What version fixes CVE-2026-73506?
Upgrading to 29.35.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/jandedobbeleer/oh-my-posh affected?
Yes, github.com/jandedobbeleer/oh-my-posh is affected in releases prior to 29.35.1. Upgrade your dependency to 29.35.1 or later.
What is the CVSS score of CVE-2026-73506?
CVE-2026-73506 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2026-73506?
CVE-2026-73506 is classified under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.).
How can I check Go dependencies for CVE-2026-73506?
Run the dependency tree command: 'inspect dependencies for github.com/jandedobbeleer/oh-my-posh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fwjx-9p69-h25h",
  "modified" : "2026-08-13T14:23:11Z",
  "published" : "2026-07-24T22:35:52Z",
  "aliases" : [ "CVE-2026-73506" ],
  "summary" : "Oh My Posh: Terminal escape sequence injection via unsanitized prompt segment data",
  "details" : "### Summary\nOh My Posh renders dynamic, potentially attacker-controlled strings (the current directory name, Git commit metadata, environment variable values, command output) into the prompt without neutralizing raw terminal control characters. An attacker who controls one of these values can inject ANSI/OSC escape sequences that the victim's terminal executes on every prompt render. (This is separate from the path-segment command-execution report; it has a different root cause and fix.)\n\n### Details\n`src/terminal/writer.go`, `write(s rune)`: the literal characters of rendered segment content are emitted to the output buffer, and the only neutralization is a lookup in `formats.EscapeSequences`, which per shell contains only the shell's prompt-length markers (`\\` for bash, `%` for zsh, nothing for fish/pwsh/cmd/nu). Raw C0/C1 control bytes (ESC `0x1b`, BEL `0x07`, CSI, OSC) are written verbatim.\n\nOh My Posh's own styling is emitted through separate paths (`writeEscapedAnsiString`, `writeColorise`, `builder.WriteString(formats.Hyperlink...)`), so any control rune reaching `write(s rune)` originates from rendered data. `trimAnsi` is already applied to the console title (`FormatTitle`) but not to the prompt body.\n\n### Attacker-controlled sources (both verified)\n1. Current directory name (default config, Linux/macOS). Directory names may contain any byte except `/` and NUL, including `0x1b`. The path segment renders the working directory in every theme.\n2. Git commit subject / author / upstream URL (cross-platform, including Windows). `Git.Commit()` runs `git log -1 --pretty=format:...su:%s...` and exposes `.Commit.Subject`, `.Commit.Author.Name`/`.Email` and `.RawUpstreamURL`; Git imposes no restriction on these, so they can carry raw escape sequences.\n\n### PoC\nGit commit-subject vector (config: a single git segment with template `{{ .Commit.Subject }}`):\n\n```\nprintf 'feat: \\033]0;HACKED\\007\\033]52;c;ZWNobyBQV05FRA==\\007 update' > msg.txt\ngit commit --allow-empty -F msg.txt\noh-my-posh print primary --config poc.omp.json --shell fish | xxd\n```\n\nOutput (excerpt) shows the attacker's OSC 0 (set title) and OSC 52 (clipboard write) passed through unmodified, wrapped only in Oh My Posh's colors:\n\n```\n...255m feat: 1b5d 303b 4841 434b 4544 07 1b5d 3532 3b63 3b5a 574e ... 07 ...\n              ESC ] 0 ; H A C K E D  BEL  ESC ] 5 2 ; c ; <base64>  BEL\n```\n\nThe directory-name vector reproduces identically via the path segment.\n\n### Impact\nThe terminal interprets the injected sequences on every render, enabling, per emulator: clipboard hijacking (OSC 52 write, so a command placed in the clipboard runs when the victim pastes), prompt/screen spoofing, window-title manipulation, and terminal denial of service. Delivery is remote (repo/archive/share); execution is local when the prompt renders after cd.\n\nSuggested fix: neutralize C0/C1 control characters in untrusted segment data before it reaches the terminal, at minimum the path segment (folder names) and the git segment (`Commit.Subject`, `Commit.Author.*`, `RawUpstreamURL`). `trimAnsi` already exists and is applied to the title; extending equivalent handling to segment data closes the gap. Filtering control runes in `write(s rune)` would also work as defense in depth (Oh My Posh's own styling never flows through that function), optionally behind an opt-out for users who deliberately embed escapes in their own templates.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/jandedobbeleer/oh-my-posh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "29.35.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 29.35.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/JanDeDobbeleer/oh-my-posh/security/advisories/GHSA-fwjx-9p69-h25h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JanDeDobbeleer/oh-my-posh/commit/edcf3c88f3fb582e84358b385c49d33d04c04224"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/JanDeDobbeleer/oh-my-posh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v29.35.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v29.36.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-150" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T22:35:52Z",
    "nvd_published_at" : null
  }
}