Skip to content
Memory corruption Disclosed report Intermediate

Assertion `col >= 0 && col < line->cols' failed, process aborted while streaming ouput from remote server

A remote server can send escape codes that cause the PuTTY client to resize its terminal in a way that triggers an assertion failure, aborting the client. This results in a denial of service and loss of scrollback data.

geeknik Follow

Originally disclosed on HackerOne

  • Triaged in 5 days
  • Fixed in 21 days
  • Paid in 18 days
  • Disclosed after 8 months

Summary: During the course of testing putty-0.70-2019-03-01.e0a7697 on Fedora 29 compiled with clang version 7.0.1 (Fedora 7.0.1-4.fc29), we discovered it was possible to abort a remote client by streaming data at it in such a way as to trigger an assertion failure in terminal.c.

putty: terminal.c:259: void clear_cc(termline *, int): Assertion `col >= 0 && col < line->cols' failed.
Aborted (core dumped)

Description: An assertion is a statement that a predicate (Boolean-valued function, i.e. a true–false expression) is always true at that point in code execution. It can help a programmer read the code, help a compiler compile it, or help the program detect its own defects.

In this case, we can trigger the PuTTY client, using escape codes streamed from a remote connection, to resize itself in such a way as to trigger this Assertion Failure which aborts the client.

Steps To Reproduce:

  1. Download https://tartarus.org/~simon/putty-snapshots/putty.tar.gz
  2. Extract putty.tar.gz
  3. change to the putty directory created in step 2.
  4. CC=clang CXX=clang++ ./configure && make -j5
  5. Launch PuTTY with your favorite debugger.
  6. Connect to a remote host of your choice
  7. On remote host: mkdir corpus && git clone https://gitlab.com/akihe/radamsa.git && cd radamsa && make && sudo make install && cd ~
  8. On remote host, upload the attached JPG file to the corpus directory we created in step 4.
  9. On remote host type while true; radamsa -s 911 -o - -n inf corpus/*; done and let run until crashes.

Supporting Material/References:

I've uploaded the core dump that happened at the time of the crash.

Impact

Denial of service, crash, loss of data contained in scroll back

Attachments

not_kitty.jpg
not_kitty.jpg From the original on HackerOne

The original report as published on HackerOne, by geeknik. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the terminal emulator does not properly validate column indices when processing resize escape sequences, leading to an assertion failure in clear_cc.

Impact

A remote server can cause a denial of service by crashing the PuTTY client, leading to loss of data in the scrollback buffer.

What the attacker needed

Victim connects to a malicious server; server sends crafted escape codes

How it was found

  1. Download and extract the PuTTY source code.
  2. Compile PuTTY with clang.
  3. Launch PuTTY under a debugger.
  4. Connect to a remote host.
  5. On the remote host, install radamsa and prepare a corpus file.
  6. Run radamsa to stream fuzzed data to the client until it crashes.

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 report has not been written yet. The Original tab links to the source.

PuTTY is a program for connecting to remote computers. A remote server can send special control codes that make PuTTY crash, so the user loses their session and any data in the scrollback buffer.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by geeknik

View all

79 more disclosed reports, best first.

More from PuTTY (European Commission - DIGIT)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.