A 32-Year-Old Bug Walks Into A Telnet Server (GNU inetutils Telnetd CVE-2026-32746 Pre-Auth RCE)
A pre-authentication buffer overflow in the LINEMODE SLC negotiation handler of GNU inetutils telnetd lets an attacker corrupt roughly 400 bytes of adjacent global variables. The researchers found no direct route to code execution on the systems they tested, but on a 32-bit Debian build an overwritten pointer could be passed to free, giving an arbitrary free primitive.
Published on labs.watchtowr.com
This research is a glimpse into the capability powering the watchTowr Platform, a Preemptive Exposure Management solution. We enable organizations to autonomously validate and mitigate their exposure to emerging threats, ahead of in-the-wild exploitation.
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 server stores client-supplied SLC triplets in a fixed-size global array without any bounds checking.
Impact
An unauthenticated attacker could corrupt adjacent global variables and, on some builds such as 32-bit Debian, cause free to be called on a chosen address; the researchers did not achieve code execution on the systems they tested, and 64-bit x86 targets were significantly harder.
What the attacker needed
Network access to a telnetd port; server built from affected source
The fix
The overflow was fixed by ignoring SLC data that would overrun the buffer.
How it was found
- Connect to the Telnet server over TCP and read its option negotiation.
- Reply that the client will use LINEMODE and TTYPE, and answer the server's subnegotiation requests.
- Send the LINEMODE SLC subnegotiation before the TTYPE subnegotiation, so the SLC data is saved into a deferred buffer instead of being processed.
- Send the TTYPE subnegotiation so terminal initialisation completes and the saved SLC data is processed, triggering the overflow.
- Observe that the overwritten deferred-buffer pointer is later passed to free.
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 way to get a text command line on a remote machine. The server keeps a fixed-size list of special characters the client wants to use, and it never checks whether the client's list is too long, so extra data spills into neighbouring memory. The researchers could not turn this into running their own code on the machines they tried, but they showed it could be a strong starting point on some builds.
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.