Skip to content

Improper handling of window title sequences can lead to arbitrary command execution

Moderate
mitchellh published GHSA-5hcq-3j4q-4v6p Dec 31, 2024

Package

Ghostty (Ghostty)

Affected versions

1.0.0

Patched versions

1.0.1

Description

Impact

Ghostty, as allowed by default in 1.0.0, allows attackers to modify the window title via a certain character escape sequence and then insert it back to the command line in the user's terminal, e.g. when the user views a file containing the malicious sequence, which could allow the attacker to execute arbitrary commands.

This attack requires an attacker to send malicious escape sequences followed by convincing the user to physically press the "enter" key. I'm not aware of attacks that do not require user interaction.

Patches

Fixed in Ghostty v1.0.1.

A new title_report configuration was added that defaults to false to disable title reporting (CSI 21 t). The documentation notes the security risk of enabling this feature, but it remains available for compatibility reasons.

PR: #3908

Workarounds

You can workaround the issue in Ghostty v1.0.0 by explicitly setting a title in the configuration. For example:

title = Ghostty

When a title is set, set title CSIs are ignored and report title in v1.0.0 will report your fixed title.

References

Severity

Moderate

CVE ID

CVE-2024-56803

Weaknesses

Credits