Skip to content
DoS Write-up Beginner

2-byte DoS in freebsd-telnetd / netbsd-telnetd / netkit-telnetd / inetutils-telnetd / telnetd in Kerberos Version 5 Applications - Binary Golf Grand Prix 3

Several telnet server implementations dereference a null pointer when they receive a two-byte telnet command sequence for erase-character or erase-line, because the corresponding terminal control table entry is never initialised. An unauthenticated attacker can crash the telnetd process, and the text also describes a variant that makes the denial of service permanent.

Pierre Kim Follow

Published on pierrekim.github.io

Home • About • Feed

Pierre Kim (@PierreKimSec), Alexandre Torres (@AlexTorSec), on pierrekim.github.io

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

The erase-character and erase-line handlers dereference a pointer from the terminal special-character table without checking whether it has been initialised, and it is null in this code path.

Impact

An unauthenticated remote attacker can crash telnetd on affected systems, and the text describes a separate permanent denial of service that may require a restart or reboot to recover.

What the attacker needed

Network access to the telnet port; no authentication needed

The fix

The code should check that the special-character table pointer is non-null before dereferencing it, defaulting to the disabled value; the author tested such a patch and it worked.

How it was found

  1. Start the telnet server (for example via inetd) on the target host.
  2. Send the two-byte erase-character or erase-line command sequence to the telnet port.
  3. Observe the telnetd process terminate with a segmentation fault.

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.

Telnet is an old protocol for remote terminal sessions. It uses special byte sequences starting with a control byte to send commands, and one of those commands tells the server to erase a character or a line. The server code reads a pointer from a table that was never filled in, so it tries to read from address zero and the program dies, which means nobody can log in over telnet until it restarts.

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.

More from FreeBSD Security Team

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.