A critical flaw in Debian-patched builds of the netkit telnet daemon lets an unauthenticated remote client inject arbitrary environment variables and reach root on affected Linux systems. Tracked as CVE-2026-141380 with a CVSS score of 9.8, the bug was disclosed on the OSS-Security mailing list by researcher Liad Levy.
How Telnet Option Negotiation Becomes Root Access
During Telnet option negotiation, a remote client can set environment variables on the server. The vulnerable code sits in Debian’s patch 124-support_uservar.diff, which builds with the -DACCEPT_USERVAR option. The patch allows variables flagged as USERVAR to skip the envvarok() whitelist that normally limits what a client may set.
The setuid-root telnetlogin wrapper then passes those variables to /bin/login. Because the whitelist check never runs, an attacker controls the environment in which the login program starts.
Attacker-Writable File and LD_PRELOAD Dependency
The attack requires one attacker-writable file on the target, such as a temporary file or an upload path. Where the service runs as root, as with Gentoo’s xinetd setup, glibc honors an injected LD_PRELOAD path. The attacker points that variable at a library placed in the writable file, and the library’s code runs with root privileges.
Distributions Where Levy Demonstrated Root Shells
Levy demonstrated root shells on Debian 13, Ubuntu 25.04 and 25.10, and Kali rolling. The affected packages include Debian’s telnetd-ssl and Gentoo’s netkit-telnetd 0.17 builds. The distributions named in the disclosure are Debian, Ubuntu, Kali and Gentoo.
A Patch Introduced in 2015
The vulnerable Debian patch dates to 2015. The flaw therefore went unflagged for roughly eleven years in code that handles remote, pre-authentication input, one of the most sensitive parts of any network service.
No Exploitation or Public Exploit Script Confirmed
At the time of disclosure, there was no confirmed exploitation in the wild and no public exploit script. The advisory’s immediate guidance is to disable the legacy telnetd service or block port 23. Distribution patches are expected to follow, and none had been listed in the reporting.
Legacy Telnet Servers, Labs and Appliances Carry the Exposure
The exposure falls on systems that still offer Telnet: legacy servers, labs and appliances. Telnet has long been replaced by SSH on most production hosts, which narrows the pool of reachable machines. For those still running it, though, the requirements are modest: network access to the service and one writable file on the target.
The disclosure also lands in a familiar category of old code with new consequences. A distribution-specific patch from 2015 converted a protocol feature into a route around a safeguard, and the combination with a setuid wrapper turned environment control into root control. Whether the other distributions that carry the same patch ship fixes on a common schedule has not been reported.
What Remains Unresolved After the OSS-Security Disclosure
The disclosure leaves open the timing of vendor fixes. Debian, Ubuntu, Kali and Gentoo have not been reported to have released updates, and the guidance stays with the interim measures of disabling the daemon or firewalling the port.
Debian Patch Lineage and the Distributions in Scope
The flaw is tied to a specific Debian patch rather than to upstream netkit code alone. Debian’s telnetd-ssl and Gentoo’s netkit-telnetd 0.17 builds are the affected packages, and the researcher’s demonstrations covered Debian 13, Ubuntu 25.04 and 25.10, and Kali rolling.
The envvarok() whitelist exists to limit which variables a Telnet client may set. Variables flagged USERVAR bypass that check in the vulnerable build, and the setuid-root wrapper passes them on to /bin/login. The disclosure rates the bug 9.8 and reports no exploitation or public exploit script. Because the flaw is reached before any login, the only precondition beyond network access is the writable file on the target, and the interim advice from the disclosure is to disable the legacy daemon or block port 23 until distribution patches arrive.
