Skip to content

GitHub CLI: GitHub Actions log output in `gh run view` allows terminal escape sequence injection

Low severity GitHub Reviewed Published May 13, 2026 in cli/cli • Updated May 19, 2026

Package

gomod github.com/cli/cli (Go)

Affected versions

>= 1.6.0, <= 1.14.0

Patched versions

None
gomod github.com/cli/cli/v2 (Go)
< 2.92.0
2.92.0

Description

Summary

A security vulnerability has been identified in GitHub CLI that could allow terminal escape sequence injection when users view GitHub Actions workflow logs using gh run view --log or gh run view --log-failed.

Details

The vulnerability stems from the way GitHub CLI handles raw Actions log output. The gh run view --log and gh run view --log-failed commands stream workflow log lines to stdout or the configured pager without sanitizing terminal control sequences. An attacker who can influence GitHub Actions log content, for example via a PR triggered workflow, can embed escape sequences that are replayed in the user's terminal when they inspect the run.

Depending on the victim's terminal emulator, injected sequences could change the window title, manipulate on screen content, or in some terminal emulators (such as screen) potentially execute arbitrary commands.

In 2.92.0, GitHub CLI sanitizes terminal control sequences in Actions log output before writing to the terminal.

PoC

Create a workflow that emits terminal escape sequences in its log output:

name: Escape Sequence PoC

on:
  workflow_dispatch:

jobs:
  emit-escape-sequences:
    runs-on: ubuntu-latest
    steps:
      - name: Emit terminal escape sequences
        run: |
          # OSC title set
          printf 'ESCAPE_MARKER_START \033]0;HIJACKED_TITLE\007 ESCAPE_MARKER_END\n'
          # CSI color
          printf 'ESCAPE_MARKER_START \033[31mRED_TEXT\033[0m ESCAPE_MARKER_END\n'
          # Screen title set (enables command execution in screen terminal)
          printf 'ESCAPE_MARKER_START \033k;malicious command;\033\\ ESCAPE_MARKER_END\n'

Then trigger the workflow and view its logs:

gh workflow run 'Escape Sequence PoC'
gh run view <run_id> --log

On vulnerable versions, the raw ESC bytes (0x1b) are passed through to the terminal unsanitized. On 2.92.0 and later, escape sequences are stripped and only the safe visible text is displayed.

Impact

An attacker who can control GitHub Actions workflow output can inject terminal escape sequences into a maintainer's terminal session when they inspect the run with gh run view --log or gh run view --log-failed. The practical impact depends on the victim's terminal emulator.

Remediation and Mitigation

  1. Upgrade gh to 2.92.0
  2. Pipe log output through a sanitizer (e.g., gh run view --log | cat -v) as a workaround on older versions
  3. Exercise caution when viewing logs from untrusted workflow runs

References

@williammartin williammartin published to cli/cli May 13, 2026
Published by the National Vulnerability Database May 15, 2026
Published to the GitHub Advisory Database May 19, 2026
Reviewed May 19, 2026
Last updated May 19, 2026

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(10th percentile)

Weaknesses

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. Learn more on MITRE.

CVE ID

CVE-2026-45803

GHSA ID

GHSA-crc3-h8v6-qh57

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.