Don’t Trust This Title: Abusing Terminal Emulators with ANSI Escape Characters
The report describes how ANSI escape sequences that change a terminal window's title can be abused to cause a denial of service on the host, and that the same underlying Windows API calls can be triggered from web browsers and other applications. An attacker could send a malicious string or link that repeatedly changes the title, freezing the terminal, browser, or even the whole computer.
cyberark.com
Published on cyberark.com
One day, while I was working on OpenShift, a Kubernetes distribution by RedHat focused on developer experience and application security, I noticed that I was able to inject ANSI escape characters to components in the web application. When a user reads the data with the injected ANSI escape characters, it executes the…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the repeated calls to Windows text-drawing functions such as SetWindowText or GdipDrawString, triggered by attacker-controlled title changes, consume excessive resources and cause the system to hang.
Impact
An attacker could cause a denial of service, freezing the terminal application, the entire computer, or a Chromium-based browser; some browsers and a hypervisor did not treat the issue as a security vulnerability, and the browser freeze was limited to the browser process due to sandboxing.
What the attacker needed
Attacker can control terminal output; victim opens a malicious file or link; no special privileges needed
The fix
The vulnerabilities were fixed in PuTTY 0.75, MobaXterm 21.0 Preview3, MinTTY 3.4.6, and Git v2.30.1; other affected applications should limit or rate-limit title changes.
How it was found
- Create a malicious string containing ANSI escape sequences that change the window title.
- Insert the string into a file or send it to a terminal or browser.
- When the string is processed, the title changes repeatedly.
- The repeated title changes cause the application or system to freeze.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Terminal emulators are programs like PuTTY that let you type commands to a remote computer. They understand special invisible characters called ANSI escape codes that can change things like the window title. The report shows that if an attacker can make the title change very rapidly, the program or even the whole computer can freeze, which is a denial of service.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.