Debian telnetd flaw can hand attackers a root shell

Published

A decade-old patch in the telnet server that Debian and its derivatives ship can let a remote stranger plant environment variables in the login process before any password is asked for, and in the right conditions that ends in a root shell. Researcher Liad Levy disclosed the bug, tracked as CVE-2026-141380, on the oss-security mailing list on December 2, and rates its worst case 9.8 out of 10.

Levy says he confirmed a pre-authentication root shell end to end on Debian 13 trixie, Ubuntu 25.04 and 25.10, and Kali rolling. Debian's security tracker currently lists the netkit-telnet-ssl package in bookworm, trixie and sid as vulnerable, with no fixed version yet. CVE program and NVD records were not yet published when this was written.

A 2015 build flag trusts the client

Telnet lets a client pass environment variables to the server while the two sides negotiate options, which happens before login. Netkit telnetd normally checks those names against an allow list. According to Levy, Debian's patch 124-support_uservar.diff, built with the ACCEPT_USERVAR option since 2015, accepts any variable the client labels as a "USERVAR", and the client controls that label. The poisoned environment is then inherited by the login child and passed through the setuid-root telnetlogin wrapper to /bin/login.

Levy describes two routes from there:

There is one real catch. Both routes need a single attacker-writable file on the target: a shared library for the first, a three-byte text file for the second. Levy lists ways to get one, including a separate file-write or path traversal bug, zip extraction flaws, an existing webshell, or a compromised CI runner. That makes this most dangerous as a second stage, turning a low-privilege foothold into root, or as quiet persistence on a box that still answers on port 23.

Debian 11 bullseye is affected by the injection itself, Levy notes, but its older util-linux 2.36 rules out the login.noauth route. He also says a related local-only variant of the login.noauth trick was already fixed in GNU inetutils telnetd as CVE-2026-28372, and that this finding reaches the same mechanism remotely.

Turn telnetd off until packages land

With no fixed package published, the practical fix is removal:

Peru's national digital security centre also flagged the flaw in its integrated alert N° 242-2026 on December 3. The same alert covered the usb2shell Linux kernel bug, another reminder that the shortest path to root on Linux often runs through software nobody remembers is installed.

This briefing is provided by IntelFusions for informational and defensive purposes only. It is based on sources assessed to be reliable at the time of writing, and analytic judgments carry the confidence levels indicated. Indicators of compromise are defanged; re-arm them only in controlled environments. IntelFusions is not affiliated with the organizations named and makes no warranty as to completeness or accuracy.

Earlier in Vulnerabilities

All Vulnerabilities briefings

Latest briefings

Read the full analysis on IntelFusions