Summary
Several GitHub CLI commands print externally controlled content to the terminal without neutralizing terminal escape sequences. An attacker who can influence that content (for example a gist file, a pull request diff, a release asset, a codespace log) can embed escape sequences that are interpreted by a user's terminal when they run one of the affected commands.
This extends the same class of issue addressed by CVE-2026-45803, which covered only gh run view --log, to the other command paths that reach the terminal without sanitization.
Details
The affected commands print content that can be influenced by an attacker to standard output or the configured pager without neutralizing terminal escape sequences. An attacker who controls that content can embed escape sequences that are interpreted by the user's terminal when the command is run.
The affected commands, and the condition under which each is affected, are:
gh gist view, when a gist file is large enough that the API returns it truncated and the CLI fetches the full content from its raw URL. Smaller gist files are returned inline as sanitized JSON and are not affected.
gh api, when the response is not JSON, such as raw file content or a diff requested through the Accept header. JSON responses were already sanitized and are not affected.
gh pr diff, when printing a pull request's diff or patch, which can carry escape sequences from the changed files.
gh release download --output -, when writing a release asset to standard output. Writing an asset to a file on disk is not affected.
gh codespace logs, when printing a codespace's logs.
gh skills preview, when previewing a skill file.
gh agent-task view and gh agent-task create, when displaying task output streamed from the server.
Impact
An attacker who can influence the content shown by an affected command can inject terminal escape sequences into the terminal of a user who views that content. The practical impact depends on the user's terminal emulator and ranges from cosmetic (title or on screen content manipulation) to, on some emulators, command execution.
Remediation and Mitigation
- Upgrade
gh to v2.97.0 or later.
- Use new
--allow-escape-sequences if you need to preserve previous behavior.
- Exercise caution when viewing content from untrusted sources.
Summary
Several GitHub CLI commands print externally controlled content to the terminal without neutralizing terminal escape sequences. An attacker who can influence that content (for example a gist file, a pull request diff, a release asset, a codespace log) can embed escape sequences that are interpreted by a user's terminal when they run one of the affected commands.
This extends the same class of issue addressed by CVE-2026-45803, which covered only
gh run view --log, to the other command paths that reach the terminal without sanitization.Details
The affected commands print content that can be influenced by an attacker to standard output or the configured pager without neutralizing terminal escape sequences. An attacker who controls that content can embed escape sequences that are interpreted by the user's terminal when the command is run.
The affected commands, and the condition under which each is affected, are:
gh gist view, when a gist file is large enough that the API returns it truncated and the CLI fetches the full content from its raw URL. Smaller gist files are returned inline as sanitized JSON and are not affected.gh api, when the response is not JSON, such as raw file content or a diff requested through theAcceptheader. JSON responses were already sanitized and are not affected.gh pr diff, when printing a pull request's diff or patch, which can carry escape sequences from the changed files.gh release download --output -, when writing a release asset to standard output. Writing an asset to a file on disk is not affected.gh codespace logs, when printing a codespace's logs.gh skills preview, when previewing a skill file.gh agent-task viewandgh agent-task create, when displaying task output streamed from the server.Impact
An attacker who can influence the content shown by an affected command can inject terminal escape sequences into the terminal of a user who views that content. The practical impact depends on the user's terminal emulator and ranges from cosmetic (title or on screen content manipulation) to, on some emulators, command execution.
Remediation and Mitigation
ghtov2.97.0or later.--allow-escape-sequencesif you need to preserve previous behavior.