← Voltar ao feed
high

CVE-2026-141380: Pre-auth environment injection in Debian-patched netkit telnetd allows remote root RCE on Debian, Ubuntu, Kali, Gentoo

2 fonte(s) · 2 atualização(ões) · publicado 02/12/2026 11:39 · coletado há 2 dias

Matéria consolidada. Reúne 2 matérias que o Tifon tinha publicado separadamente sobre a mesma história. A IA reescreveu o relatório com o que as 2 fontes trouxeram em 03/12/2026 12:04; os links antigos trazem para cá.

Fontes: gbhackers.com ↗ securityonline.info ↗

CVE-2026-141380 is a pre-authentication flaw (CVSS 9.8) in netkit telnetd 0.17 as built with Debian's 124-support_uservar.diff patch (-DACCEPT_USERVAR). It affects the telnetd and telnetd-ssl packages and downstream distributions including Ubuntu, Kali and Gentoo. A remote, unauthenticated client can inject arbitrary environment variables during Telnet option negotiation, which can lead to root code execution. Researcher Liad Levy disclosed it on OSS-Security and demonstrated root shells on Debian 13, Ubuntu 25.04/25.10 and Kali rolling (securityonline.info, gbhackers.com). Neither source reports exploitation in the wild, and securityonline.info reports no public exploit script. Distro fixes were still pending at publication (securityonline.info), and gbhackers.com reports no patched packages. Neither source verified a vendor advisory, NVD entry or fixed versions.

Entenda a falha

A vulnerabilidade

CVE-2026-141380 is a pre-authentication flaw in netkit telnetd 0.17 as built by Debian with the 124-support_uservar.diff patch (-DACCEPT_USERVAR). It affects the telnetd and telnetd-ssl packages (source package telnet 0.17-42 and earlier) and downstream Ubuntu, Kali and Gentoo (net-misc/netkit-telnetd). A remote, unauthenticated client can inject environment variables during Telnet option negotiation, which can lead to root code execution. Every attack path also needs one attacker-writable file on the target. The CVSS is reported as 9.8, but GBHackers says that figure applies to the most severe configuration and that the vector was not verified. Debian 11 is affected by the injection, but its util-linux 2.36 lacks login.noauth. No fixed versions or patched packages were reported as of 2026-12-03.

Como funciona

During the initial Telnet option negotiation, the client sends NEW-ENVIRON variables and flags some as USERVAR. The server passes them to setenv() before startslave() forks the login child, which inherits the poisoned environment. The setuid-root telnetlogin wrapper forwards it to /bin/login, checking only TERM and REMOTEHOST. If telnetd runs as root (legacy inetd entries, Gentoo's xinetd default), glibc honors LD_PRELOAD and a planted shared object runs as root before any login prompt. In Debian's default non-root setup, LD_* is stripped but CREDENTIALS_DIRECTORY passes through. With util-linux 2.40 or later, login skips PAM if a login.noauth file in that directory contains yes, so injecting USER=root gives a root shell without a password.

Por que é vulnerável

Debian's patch 124-support_uservar.diff builds telnetd with ACCEPT_USERVAR and changes the NEW-ENVIRON handler so that variables flagged USERVAR are accepted through an is_uservar condition. Since the client sets that flag, the envvarok() whitelist is bypassed entirely. The telnetlogin wrapper then trusts the inherited environment and validates only two variables. The ACCEPT_USERVAR build dates from 2015, so exposed hosts have been at risk for over ten years. Suggested fixes: revert the is_uservar relaxation in suboption(), drop ACCEPT_USERVAR, or enforce a strict whitelist in telnetlogin.

Onde está

Debian patch 124-support_uservar.diff, which edits the NEW-ENVIRON handler suboption() in telnetd/state.c (the "|| is_uservar" condition); also startslave() and the telnetlogin wrapper.

Como foi descoberta

Researcher Liad Levy disclosed the flaw on oss-security and demonstrated end-to-end root shells on Debian 13 trixie, Ubuntu 25.04 and 25.10, and Kali rolling. The articles do not say how it was found or how it was reported to vendors. Neither reports exploitation in the wild. GBHackers compares it to an earlier GNU InetUtils authentication bypass, and securityonline.info mentions CVE-2026-28372, a related local bug in GNU inetutils.

PoC existente, privada

O exploit existe, mas quem o tem não o publicou.

Levy demonstrated working root exploitation covering both the LD_PRELOAD path (telnetd as root) and the login.noauth path (non-root, util-linux 2.40 or later). securityonline.info says no public exploit script has been released, so the working exploit appears to be held by the researcher. Because the paths work on default setups and the demonstrated chain is complete, treat it as urgent wherever port 23 is reachable: disable telnetd, use SSH and block TCP/23 until patched packages exist.

Explicação gerada por IA a partir da matéria e dos artigos, em 03/12/2026 12:19.

Detalhes técnicos

  • The Debian patch changes telnetd/state.c so that variables flagged USERVAR bypass the envvarok() whitelist and go to setenv(). The login child forked by startslave() inherits them, and the setuid-root telnetlogin wrapper checks only TERM and REMOTEHOST before calling /bin/login (securityonline.info, gbhackers.com).
  • Every attack path requires one attacker-writable file on the target, such as a temp file or upload path. Examples given are path traversal, zip-slip, an existing webshell or a compromised CI runner. This limits real-world exposure (securityonline.info, gbhackers.com).
  • If telnetd runs as root (legacy inetd entries, Gentoo xinetd default), glibc honors an injected LD_PRELOAD, so a shared library runs as root inside /bin/login before the login prompt. A planted .so re-executes as root on every connection to port 23, giving persistence (gbhackers.com).
  • If telnetd runs as non-root (Debian default inetd setup), glibc strips LD_* variables, but CREDENTIALS_DIRECTORY passes through. On util-linux 2.40 or later, pointing it at a directory with a login.noauth file (containing "yes") makes login skip PAM. Injecting USER=root with a writable CREDENTIALS_DIRECTORY yields a root shell without a password (securityonline.info, gbhackers.com).
  • Affected: Debian/Ubuntu/Kali telnetd and telnetd-ssl (source package telnet 0.17-42 and earlier) and Gentoo net-misc/netkit-telnetd. The ACCEPT_USERVAR build dates from 2015 (gbhackers.com). Debian 11 is affected by the injection, but util-linux 2.36 lacks login.noauth, so that variant does not work there.
  • securityonline.info mentions CVE-2026-28372, a related local bug in GNU inetutils.

Remediação

  • Stop or remove telnetd and use SSH.
  • If Telnet must stay, block TCP/23 at the network edge and allow only trusted admin networks.
  • Distro maintainers: revert the || is_uservar bypass in suboption() or drop ACCEPT_USERVAR, and add a strict environment whitelist in telnetlogin.
  • Watch distro security trackers for patched packages; none were reported as of 2026-12-03.

Relatos divergentes

  • Severity: securityonline.info gives CVSS 9.8 flatly, while gbhackers.com (the more recent, 2026-12-03) says 9.8 applies to the most severe configuration under CVSS 3.1 and notes the vector was not verified. The non-root default setup needs extra conditions (util-linux 2.40+).

Linha do tempo

  1. gbhackers.com ↗ · pub. 03/12/2026 03:19 · coletado 03/12 05:00

    Debian netkit telnetd ACCEPT_USERVAR flaw (CVE-2026-141380) allows pre-auth environment injection and root code execution

    ler a análise desta fonte

    A pre-authentication flaw, CVE-2026-141380, affects the Debian-built netkit telnetd 0.17 (telnetd and telnetd-ssl packages) and downstream distributions including Ubuntu, Kali and Gentoo. The article reports a CVSS 3.1 score of 9.8 in the most severe configuration. A remote, unauthenticated client can inject arbitrary environment variables, which can lead to root code execution. The article does not report exploitation in the wild. This research did not include web searches, so the vendor advisory, fixed versions and CVSS vector were not verified.

    Technical Details

    • Debian patch 124-support_uservar.diff builds telnetd with ACCEPT_USERVAR. The NEW-ENVIRON handler in telnetd/state.c then passes any client-flagged USERVAR to setenv(), bypassing the envvarok() whitelist.
    • The poisoned environment is inherited by the login child forked by startslave(). The setuid telnetlogin wrapper checks only TERM and REMOTEHOST before calling /bin/login.
    • When telnetd runs as root (legacy inetd entries, Gentoo's xinetd config), glibc honors LD_PRELOAD. An attacker-supplied shared object then runs as root before authentication.
    • In Debian's default non-root inetd setup, glibc strips LD_* variables. However, CREDENTIALS_DIRECTORY survives. With util-linux 2.40 or later, login skips PAM if login.noauth in that directory contains "yes". Injecting USER=root plus a writable CREDENTIALS_DIRECTORY gives a root shell without a password.
    • Each path requires the attacker to be able to write one file on the target, for example through path traversal, zip-slip, an existing webshell or a compromised CI runner. This limits real-world exposure. A planted .so file re-executes as root on every connection to port 23, which gives persistence.
    • Researcher Liad Levy confirmed exploitation on Debian 13 trixie, Ubuntu 25.04 and 25.10, and Kali rolling. Debian source package telnet 0.17-42 and earlier is vulnerable, and the ACCEPT_USERVAR build dates from 2015. Debian 11 is affected by the injection, but the login.noauth variant needs util-linux 2.40 or newer.

    Remediation

    No patched packages are reported. Suggested code fixes are to revert the || is_uservar relaxation in suboption(), drop ACCEPT_USERVAR, or enforce a whitelist in telnetlogin. Disable telnetd where possible, move to SSH and block port 23 at the network edge.

  2. securityonline.info ↗ · pub. 02/12/2026 11:39 · coletado 02/12 13:00 primeiro registro

    CVE-2026-141380: Pre-auth environment injection in Debian-patched netkit telnetd enables remote root RCE on Debian, Ubuntu, Kali, Gentoo

    ler a análise desta fonte

    Researcher Liad Levy disclosed CVE-2026-141380 on OSS-Security. It is a CVSS 9.8 flaw in netkit telnetd 0.17 as built with Debian's 124-support_uservar.diff patch (-DACCEPT_USERVAR). The patch lets an unauthenticated remote client inject arbitrary environment variables during Telnet option negotiation, and this can lead to root RCE. The article reports no confirmed in-the-wild exploitation and no public exploit script. Levy demonstrated root shells on Debian 13, Ubuntu 25.04/25.10 and Kali rolling. Distro fixes were still pending at publication. The article's sources are limited to the article itself; no vendor advisory, NVD entry or fix was checked.

    Technical Details

    • The Debian patch edits telnetd/state.c so that variables flagged USERVAR skip the envvarok() whitelist. The child process inherits them, and the setuid-root telnetlogin wrapper passes them to /bin/login.
    • Every attack path needs one attacker-writable file on the target, such as a temp file or an upload path.
    • If the service runs as root (Gentoo xinetd default), glibc honors an injected LD_PRELOAD, so a shared library runs as root inside /bin/login before the login prompt.
    • If the service runs as non-root (Debian default), glibc strips LD_* variables, but CREDENTIALS_DIRECTORY passes through. On util-linux 2.40 or newer, pointing it at a directory containing a login.noauth file skips PAM and gives a root shell.
    • Affected: Debian/Ubuntu/Kali telnetd and telnetd-ssl (source telnet, 0.17-42 and earlier), and Gentoo net-misc/netkit-telnetd. Debian 11 is affected by the injection itself, but util-linux 2.36 lacks login.noauth.
    • The article mentions CVE-2026-28372, a related local bug in GNU inetutils.

    Remediation

    • Stop or remove telnetd and use SSH.
    • If Telnet must stay, block TCP/23 and allow only trusted admin networks.
    • Distro maintainers: revert the is_uservar bypass in suboption() or drop ACCEPT_USERVAR, and add a strict environment whitelist in telnetlogin.