Netkit telnetd flaw CVE-2026-141380 gives root without a password on Debian, Ubuntu and Kali


If you still run a Telnet server on a Debian-based system, switch it off today. Researcher Liad Levy has shown that a Telnet client can get a root shell on Debian 13, Ubuntu 25.04 and 25.10, and Kali Linux without ever seeing a password prompt.
Levy
posted the details to oss-security on 2 December.
The flaw, CVE-2026-141380, sits in the Netkit telnetd that Debian ships
and that Ubuntu, Kali and Gentoo build on. He scores the worst case at
CVSS 3.1 9.8. No vendor has published its own score, and no attacks have
been reported.
A patch that skipped the allow list
Telnet clients can send environment variables to the server during the
opening option negotiation, before anyone logs in. telnetd normally
checks each one against an allow list. Since 2015, Debian has built
Netkit telnetd with a patch that accepts any variable the client labels
as a user variable (USERVAR), and that label is entirely up to the client.
So an unauthenticated client can set whatever environment it likes. The
login process inherits it, and Debian’s telnetlogin wrapper passes it
straight to /bin/login, checking only TERM and REMOTEHOST.
Two routes to root
What happens next depends on how telnetd runs.
When the daemon runs as root, as with older inetd entries, service
units without a User= line, and Gentoo’s shipped xinetd config, the
attacker sets LD_PRELOAD. /bin/login then loads the attacker’s shared
library and runs it as root before any authentication.
When the daemon runs as a normal user, which is Debian’s default, the
system strips LD_PRELOAD. But it doesn’t strip CREDENTIALS_DIRECTORY.
In util-linux 2.40 and later, login skips PAM authentication entirely if
that directory holds a file called login.noauth containing “yes”. The
attacker sets USER=root and points CREDENTIALS_DIRECTORY at a folder
they control, and gets a root shell. Levy notes that the file is three
bytes of plain text.
Both routes need one thing: a file the attacker can write on the target.
Levy lists ways to get one, such as an upload bug, a path traversal or
zip-slip flaw, or an existing low-privilege foothold like a web shell. On
an already compromised machine, the trick also works as a back door, since
telnetd starts fresh for every connection to port 23.
A similar, local-only use of login.noauth was fixed earlier as
CVE-2026-28372 in GNU Inetutils telnetd, a different Telnet server.
That fix doesn’t touch Netkit. This flaw reaches the same login behaviour
remotely, before login.
Who is affected
Levy says Debian’s telnetd and telnetd-ssl packages at version 0.17-42
and earlier are vulnerable. He got a root shell on Debian 13 “Trixie”
using telnetd-ssl with Debian’s default settings, and repeated it on
Ubuntu 25.04, Ubuntu 25.10 and Kali Rolling, which ship the same source
package. Gentoo’s net-misc/netkit-telnetd applies Debian’s patches and
runs as root, so it’s open to the LD_PRELOAD route.
Debian 11 accepts the injected variables, but its util-linux 2.36 is too
old for the login.noauth route.
The
Debian security tracker
lists netkit-telnet-ssl as vulnerable in Debian 12, Debian 13 and
testing, and marks both netkit-telnet and netkit-telnet-ssl as
unfixed. Debian is tracking it as bug 1156205.
What to do
There’s no patch, so the fix for now is to stop running Telnet.
- Find it. Check whether
inetdorxinetdis running withsystemctl status inetd xinetd, and look for anything listening on port 23 withss -tlnp | grep ':23 '. - Turn it off. Disable
telnetdand remove the package if you don’t need it. Use SSH for remote access instead. - Block port 23. Drop TCP 23 at your network edge and between internal segments, especially around labs, appliances and OT networks.
- Watch for the update. Follow the Debian, Ubuntu and Gentoo security notices for one that names CVE-2026-141380, and install it as soon as it lands.