By Hamza Faisal

A critical security flaw in the Netkit Telnet server can hand remote attackers root access to vulnerable Linux systems — without a password. Security researcher Liad Levy disclosed the vulnerability, tracked as CVE-2026-141380, on the Openwall oss-security mailing list on December 2, and assigned it a CVSS score of 9.8 out of 10.

The flaw affects Debian 13 “Trixie”, Ubuntu 25.04 and 25.10, and Kali Linux Rolling, along with Gentoo systems running the Netkit telnetd package. It is a pre-authentication environment injection bug: an attacker can tamper with the environment variables a Telnet server passes to its login program before any username or password is ever checked.

A Debian patch opened the door

The root cause sits in a Debian downstream patch for Netkit telnetd 0.17. The build is compiled with a flag that lets the daemon accept client-supplied environment variables marked as user-defined during Telnet option negotiation — and the client fully controls that marker. That bypasses the daemon’s normal allowlist of permitted variables, so a remote, unauthenticated attacker can set arbitrary environment variables inside the daemon process before authentication begins.

The poisoned environment is then inherited by the login child process. A setuid-root helper called telnetlogin forwards it verbatim to /bin/login, which validates only the values of two variables, TERM and REMOTEHOST. The rest passes straight through.

Two paths to a root shell

How the flaw turns into root access depends on how the daemon is configured. When telnetd runs with root privileges, as in some legacy setups, the injected environment can abuse the glibc dynamic loader: an attacker-supplied shared library’s code runs as root inside /bin/login before any authentication takes place. Levy rated that path 9.8 on the CVSS scale.

When the daemon runs as a less privileged user, as in Debian’s shipped configuration, secure-execution protections block that loader route — but Levy found a second one. The login program in util-linux 2.40 and later honours a CREDENTIALS_DIRECTORY variable that is not stripped, so injecting USER=root plus a writable credentials directory containing a tiny login.noauth file yields an unauthenticated root shell, with no password prompt ever shown.

Both paths need one thing beyond reaching a Telnet listener: an attacker-writable file on the target system. Levy confirmed passwordless root access in testing on Debian 13, Ubuntu 25.04 and 25.10, and Kali Linux Rolling. No attacks in the wild have been confirmed — the disclosure reports successful tests, not exploitation.

No patch yet — what to do now

There is no released fix at the time of disclosure. Levy proposed restoring strict checks on client-supplied settings, or filtering what the privileged helper passes to the login program, but those are proposals, not a patch. The flaw is also distinct from a related GNU Inetutils Telnet issue tracked as CVE-2026-28372: a fix for that one does not fix Netkit, so the two must be tracked separately in package inventories.

Until a fix is confirmed, administrators should keep affected Telnet services off untrusted networks and watch their distribution’s security notices for an update that explicitly names CVE-2026-141380 and covers the installed Netkit package. The deeper lesson is an old one: Telnet is a legacy protocol from an era before encrypted remote access, and most systems have no reason to expose it at all. Anyone still running it should treat this disclosure as the prompt to switch it off — or at least to make sure it can never be reached from the internet.