# Netkit Telnet server (telnetd) Debian-patch flaw enables passwordless root access - CVE-2026-141380

> Debian's patch series for Netkit telnetd (packages telnetd and telnetd-ssl, also Gentoo net-misc/netkit-telnetd) lets a remote client set arbitrary environment variables before authentication by flagging them as USERVAR. A setuid helper forwards them to /bin/login, which gives passwordless root when the attacker can write one file on the target. The reporter rates it CVSS 3.1 9.8.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-03T04:15:27Z
- **Last updated:** 2026-12-03T04:15:27Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7357
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7357.png
- **ID:** TL-2026-7357
- **Severity:** CRITICAL (CVSS 9.8)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 8
- **CVEs:** CVE-2026-141380, CVE-2026-24061, CVE-2026-28372

## Description

CVE-2026-141380 is a pre-authentication environment injection in the Netkit telnetd build shipped by Debian and derivatives. It was disclosed by researcher Liad Levy on oss-security on 2026-12-02 and tracked in Debian bug #1156205. The Debian build is compiled with -DACCEPT_USERVAR, and patch 124-support_uservar.diff changes the NEW-ENVIRON handler in suboption() (telnetd/state.c). A variable is now accepted when envvarok(varp) || is_uservar is true, so any variable the client flags as USERVAR is set with setenv() and skips the envvarok() whitelist. The client controls the flag. The variables are set during option negotiation, before startslave() forks the login child, so the child inherits the poisoned environment. The setuid-root telnetlogin helper forwards the environment to /bin/login and validates only TERM and REMOTEHOST. The ACCEPT_USERVAR build dates to 2015.

Path 1 applies when the daemon runs as root, for example legacy inetd entries, service units without User=, or Gentoo's shipped xinetd configuration. No privilege transition happens, AT_SECURE is not set, and glibc honors LD_PRELOAD. An attacker-supplied shared object's constructor then runs as root inside /bin/login before authentication. This needs one attacker-writable file on the target. Without it the loader prints an error and continues. Examples of a file-write primitive are an arbitrary file write, path traversal in an upload handler, zip-slip, user-controlled temp files, a low-privilege RCE, or an existing .so left by an earlier compromise.

Path 2 applies when the daemon runs as non-root, as in Debian's shipped inetd entry. telnetlogin sets AT_SECURE, so glibc strips LD_* variables, but CREDENTIALS_DIRECTORY is not stripped. In util-linux login 2.40 and later, PAM authentication is skipped if $CREDENTIALS_DIRECTORY/login.noauth exists and contains 'yes'. Injecting USER=root and CREDENTIALS_DIRECTORY=<writable dir> gives a root shell with no password prompt. This needs the three-byte login.noauth file in a writable directory. The reporter says payloads using HOME or PROMPT_COMMAND do not persist to later logins, because inetd forks a fresh daemon per connection.

The reporter confirmed passwordless root on Debian 13 trixie (0.17.41+really0.17-6, util-linux login 2.41.5, non-root inetd entry), and reports Ubuntu 25.04, Ubuntu 25.10 and Kali Linux Rolling as affected because they use the same source package. Debian 11 bullseye (util-linux 2.36) accepts the injection, but the login.noauth path needs util-linux 2.40 or later. The Debian Security Tracker lists bookworm, trixie, forky and sid as vulnerable with no fixed version. It is a different bug from CVE-2026-28372, a local-only variant in GNU Inetutils telnetd, and from CVE-2026-24061, the GNU Inetutils USER='-f root' bypass. The Inetutils fixes do not fix Netkit. The 9.8 score is the reporter's CVSS 3.1 rating for the root pre-authentication RCE case, and no vector string was published. No in-the-wild exploitation, public PoC release, attribution or IOCs are reported. The primary sources describe tested exploitation only.

## MITRE ATT&CK

- T1595.002 Vulnerability Scanning
- T1190 Exploit Public-Facing Application
- T1133 External Remote Services
- T1059.004 Unix Shell
- T1574.006 Dynamic Linker Hijacking
- T1574.006 Dynamic Linker Hijacking
- T1574.006 Dynamic Linker Hijacking
- T1556 Modify Authentication Process
- T1556 Modify Authentication Process

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Netkit telnetd CVE-2026-141380 - Root Shell Spawned From telnetlogin/login Chain (Exploitation)** (`TL-2026-7357-SPL-001`)

Detects the outcome of CVE-2026-141380 (TL-2026-7357): the Debian-patched Netkit telnetd chain in.telnetd -> telnetlogin (setuid helper) -> /bin/login ends in a root shell. Pairs a telnetlogin/in.telnetd process start with a root shell spawned by login on the same host within 30 seconds. Root over Telnet is normally blocked by securetty/PAM, so a root shell here is consistent with the passwordless-root result of both the LD_PRELOAD path (root-run daemon, constructor runs inside /bin/login) and the login.noauth/CREDENTIALS_DIRECTORY path (non-root daemon, util-linux 2.40+, USER=root). The result is an unauthenticated session on a local account (valid account abuse, T1078.003) obtained by exploiting an internet-facing service. Sysmon for Linux does not record process environments, so the rule keys on the resulting behaviour, not on the injected USERVAR variables (LD_PRELOAD, CREDENTIALS_DIRECTORY, USER=root). Requires Sysmon for Linux (EventCode 1).

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1556, T1078.003, T1059.004
- **Data sources:** sysmon_for_linux, index=linux sourcetype=sysmon:linux
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=linux sourcetype=sysmon:linux EventCode=1 ((Image=*/telnetlogin OR Image=*/in.telnetd) OR (ParentImage=*/login User=root (Image=*/bash OR Image=*/sh OR Image=*/dash OR Image=*/zsh)))
| eval stage=if(match(Image, "/(telnetlogin|in\.telnetd)$"), "telnet_helper", "root_shell")
| bin _time span=30s
| stats dc(stage) as stages values(Image) as images values(ParentImage) as parents values(CommandLine) as cmdlines by host _time
| where stages=2
```

### Microsoft KQL

```kql
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ('bash','sh','dash','zsh')
| where InitiatingProcessFileName =~ 'login'
| where InitiatingProcessParentFileName in~ ('telnetlogin','in.telnetd','telnetd')
| where AccountName =~ 'root'
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName
```

### Sigma

```yaml
title: Root Shell Spawned By login (Netkit telnetd CVE-2026-141380 Exploitation)
id: 7b0f3c1e-5a52-4d0e-9a41-2c6e8f1d7a01
status: experimental
description: Detects an interactive root shell spawned by /bin/login. With Debian-patched Netkit telnetd (CVE-2026-141380) this is the outcome of passwordless root via LD_PRELOAD or login.noauth. Sigma cannot express the telnetlogin grandparent, so correlate with telnetd activity on the host.
references:
    - https://openwall.com/lists/oss-security/2026/12/02/4
    - https://security-tracker.debian.org/tracker/CVE-2026-141380
author: Threadlinqs Team
date: 2026/12/03
tags:
    - attack.initial-access
    - attack.t1190
    - attack.credential-access
    - attack.t1556
    - attack.defense-evasion
    - attack.persistence
    - attack.privilege-escalation
    - attack.t1078.003
    - attack.execution
    - attack.t1059.004
    - cve.2026.141380
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        ParentImage|endswith: '/login'
        Image|endswith:
            - '/bash'
            - '/sh'
            - '/dash'
            - '/zsh'
        User: 'root'
    condition: selection
falsepositives:
    - Legitimate root logins on a local console or serial line
    - Administrators permitted to log in as root over Telnet via securetty
level: high
```

**Known false positives:**

- Legitimate root logins over Telnet on legacy systems where securetty/PAM permit root
- Telnet-based break-glass or lab administration performed as root

**Tuning notes:** Adjust index/sourcetype to your Sysmon for Linux ingestion. Widen the span if host clocks drift. Where Telnet is permitted, exclude known management source addresses by joining with network telemetry. Any hit on a host that should not run telnetd is high priority. Pair with the login.noauth (SPL-002) and root-run telnetd (SIG-002) detections to identify which exploitation path was used.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Netkit [indicator] CVE-2026-141380 - Inbound Telnet Followed by Root Login Shell (Exploitation) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - Shared Object Dropped in World-Writable Directory (LD_PRELOAD Staging) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - Outbound Telnet From Linux Servers (Lateral Movement) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - telnetlogin Helper Launching [indicator] (Exposure / Exploitation Hunting) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - Telnet Daemon Running as Root (LD_PRELOAD-Exposed Configuration) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - Shell Interpreter Making Outbound Connection (Post-Root Reverse Shell / C2) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - [indicator] File Created (Credentials Directory Auth Bypass) (locked: unlock with TL Creds)
- Netkit [indicator] CVE-2026-141380 - Telnet Scanning and Repeated Connection Bursts on TCP/23 (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [oss-security: pre-authentication environment injection in netkit telnetd (CVE-2026-141380)](https://openwall.com/lists/oss-security/2026/12/02/4)
- [Cyber Security News: Critical Telnet Flaw Lets Hackers Gain Root Access to Ubuntu and Kali Linux Without Passwords](https://cybersecuritynews.com/netkit-telnet-vulnerability/)
- [Debian Security Tracker: CVE-2026-141380](https://security-tracker.debian.org/tracker/CVE-2026-141380)
- [Debian Security Tracker: CVE-2026-24061 (GNU Inetutils telnetd USER bypass, related)](https://security-tracker.debian.org/tracker/CVE-2026-24061)
- [oss-security: GNU Inetutils telnetd authentication bypass advisory (related)](https://www.openwall.com/lists/oss-security/2026/01/20/2)
- [OpenCVE: CVE-2026-28372 (GNU Inetutils, local-only variant)](https://app.opencve.io/cve/CVE-2026-28372)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7357
