TL;DR
Researcher Liad Levy disclosed a critical CVSS 9.8 netkit telnetd vulnerability tracked as CVE-2026-141380 on OSS-Security. The bug allows pre-auth telnetd environment injection that can yield remote root RCE on Debian, Ubuntu, Kali, and Gentoo. Therefore, Linux admins should turn off legacy telnetd services or lock down port 23 right away.
Why It Matters
Although Telnet is old, many legacy Linux servers, test labs, and appliances still run Debian’s telnetd-ssl or Gentoo’s netkit-telnetd. Because the root patch dates back to 2015, open hosts have faced this risk for over ten years. In his OSS-Security advisory, Levy writes, “A remote unauthenticated client can inject arbitrary environment variables during Telnet option negotiation.”
At press time, no active raids in the wild have been confirmed. Likewise, no public exploit script has dropped yet. However, Levy proved end-to-end root shells on Debian 13, Ubuntu 25.04 and 25.10, and Kali rolling. Still, the ease of this netkit telnetd vulnerability puts any open port 23 host at high risk.
How the Attack Works
Bypassing the Environment Whitelist
The bug sits in Debian’s patch 124-support_uservar.diff, which builds netkit telnetd 0.17 with -DACCEPT_USERVAR. That patch edits telnetd/state.c so the server accepts any variable marked as USERVAR. Because the client sets that flag, it skips the envvarok() whitelist. Next, the forked child inherits the bad variables, and the setuid-root telnetlogin wrapper passes them straight to /bin/login.
Two Paths to Pre-Auth Root Access
To get root, a foe needs one writable file on the target host, such as a temp file or upload path. Levy notes, “In all cases the attacker is unauthenticated and remote; the single prerequisite in every path is one attacker-writable file on the target.” From there, the attack splits into two paths based on service rights.
First, when the service runs as root (such as Gentoo’s xinetd setup), glibc honors an injected LD_PRELOAD path. A shared library on disk then runs as root inside /bin/login before any login prompt. Second, when the service runs as non-root (Debian’s default), glibc strips LD_* vars, but CREDENTIALS_DIRECTORY passes through. On hosts with util-linux 2.40 or newer, pointing that var to a folder with a three-byte login.noauth file skips PAM checks and drops a root shell. A related local bug in GNU inetutils was tracked as CVE-2026-28372.
Affected Versions
- Debian / Ubuntu / Kali:
telnetdandtelnetd-sslpackages (sourcetelnet, 0.17-42 and earlier). Thelogin.noauthroot bypass needsutil-linux2.40 or newer (verified on Debian 13 trixie, Ubuntu 25.04/25.10, and Kali rolling). - Debian 11 (bullseye): Affected by the injection itself (
util-linux2.36 lackslogin.noauth). - Gentoo Linux:
net-misc/netkit-telnetd(uses Debian’s patches and runs as root by default via xinetd).
Patch and Mitigation Steps
Because distro fixes are still pending, admins should stop or remove telnetd and use SSH right away. If you must keep Telnet, block TCP port 23 at the firewall and allow only trusted admin nets.
For distro teams, Levy advises reverting the is_uservar bypass in suboption() or dropping ACCEPT_USERVAR. Maintainers can also add a strict environment whitelist in telnetlogin to close this netkit telnetd vulnerability.
Support Our Threat Intelligence
Find our vulnerability reports and weekly recaps helpful? Support our work today and unlock a 100% ad-free reading experience!