A pre-authentication environment-injection defect in Debian’s netkit telnetd build lets a remote client poison the daemon’s environment during Telnet option negotiation.
Depending on how the service is launched, this results in unauthenticated root code execution. Researcher Liad Levy disclosed CVE-2026-141380 on oss-security on December 2, 2026. He rated the root-RCE path at CVSS 3.1 9.8. Reports so far describe successful lab tests, not confirmed in-the-wild exploitation.
The defect comes from Debian’s patch 124-support_uservar.diff. It compiles netkit telnetd 0.17 with -DACCEPT_USERVAR and changes the NEW-ENVIRON suboption handler in suboption() (telnetd/state.c). The acceptance check becomes if (envvarok(varp) || is_uservar) setenv(...) .
Netkit telnetd CVE-2026-141380
The client alone sets the is_uservar flag, so the envvarok() allowlist is bypassed completely. The ACCEPT_USERVAR build dates back to 2015
The injection happens before startslave() forks the login child. The child inherits the tainted environment, and the setuid-root telnetlogin wrapper forwards it unchanged to /bin/login.
The wrapper validates only TERM and REMOTEHOST. This is a classic trust-boundary failure: attacker-controlled data crosses a privileged exec boundary without sanitization. Similar unsanitized-input defects are driving critical RCE exploitation elsewhere, such as the WP Rocket unauthenticated RCE tracked as CVE-2026-125812.
LD_PRELOAD Path When telnetd Runs as Root
If the daemon runs as root, no privilege transition occurs in the exec chain. That covers legacy inetd entries, units without User=, and Gentoo’s shipped xinetd configuration. AT_SECURE is never set, so glibc honors an injected LD_PRELOAD. The constructor of an attacker-supplied shared object then runs as root inside /bin/login, before any authentication.
The exploit needs one attacker-writable file on the target. Without it, the dynamic loader only prints a “cannot be preloaded” error and execution continues normally.
In practice, that file can come from a path traversal in an upload handler, zip-slip during archive extraction, or an application writing user-controlled temp files to /tmp or /dev/shm.
Write primitives like these are common in modern intrusion chains. Underground markets show strong demand for such primitives, and a recent analysis found that RCE and local privilege escalation lead zero-day exploit listing
Debian’s default inetd entry runs telnetd as a non-root user. In that case telnetlogin executes with AT_SECURE set, and glibc strips LD_* variables. However, CREDENTIALS_DIRECTORY is not stripped. /bin/login from util-linux 2.40 or later honors it. If $CREDENTIALS_DIRECTORY/login.noauth exists and contains “yes”, login skips PAM authentication entirely.
telnetlogin calls setuid(0), and telnetd’s start_login() passes getenv("USER") to /bin/login as an argument. USER is just another injectable USERVAR. Sending USER=root together with a writable CREDENTIALS_DIRECTORY yields a root shell without a password prompt.
The payload is a three-byte plain-text file rather than an ELF binary, which makes this variant cheap to stage. Levy links it to a local-only variant of the same login mechanism, addressed as CVE-2026-28372 in GNU inetutils telnetd.
Affected Builds and Confirmed Exploitation
Debian telnetd and telnetd-ssl (source package telnet, 0.17-42 and earlier) are affected. Levy verified end-to-end pre-auth root shells on Debian 13 trixie (0.17.41+really0.17-6 with util-linux login 2.41.5), Ubuntu 25.04 and 25.10, and Kali rolling.
Gentoo’s net-misc/netkit-telnetd applies Debian’s patch series and is exposed through the LD_PRELOAD route. Debian 11 bullseye (util-linux 2.36) is affected by the injection itself, but the login.noauth bypass needs util-linux 2.40 or later.
Red Hat rates the issue Critical but states that Red Hat Enterprise Linux is not affected. Its telnet package does not include the Debian-specific patch that enables client-defined user variable processing.
Because inetd or xinetd launches telnetd per connection, a planted .so on disk re-executes as root on every future connection to port 23.
That makes the issue useful for persistence on an already-compromised host. A low-privilege foothold, such as a webshell or a compromised CI runner, plus a running telnetd is enough for local privilege escalation, even if the daemon listens only on localhost.
Levy also refuted one theory. Each connection gets a fresh in.telnetd, so an injected environment never reaches a later user’s login. Payloads such as HOME=/.bash_profile or PROMPT_COMMAND only run after the attacker has authenticated as root on their own session, with credentials they must already hold.
Mitigation
Maintainers can revert the || is_uservar relaxation in suboption(), drop ACCEPT_USERVAR entirely, or make telnetlogin enforce a strict allowlist on the environment it forwards.
Administrators should disable legacy telnetd and block TCP/23 at the perimeter right away. Hosts that must keep netkit telnetd should check distribution advisories for an update that explicitly names CVE-2026-141380. Migrate remote administration to SSH with key-based authentication.
Also audit world-writable paths and review inetd and xinetd unit files for daemons running as root. The same discipline applies to developer infrastructure. Delimiter-injection flaws have recently enabled command execution through a single git push on GitHub.
FAQ
Is CVE-2026-141380 exploited in the wild? No confirmed attacks yet, only researcher-verified root shells on several distributions.
Which systems are affected? Debian telnetd and telnetd-ssl 0.17-42 and earlier, Ubuntu, Kali and Gentoo netkit-telnetd.
Is RHEL affected? No, Red Hat’s telnet package lacks the Debian-specific USERVAR patch.
What is the fastest mitigation? Disable telnetd, block TCP/23, and apply distribution updates that name the CVE.