GNU inetutils telnetd Local Privilege Escalation via NEW-ENVIRON Injection — CVE-2026-28372
by Rohitberiwala (Mohammed Idrees Banyamer, @banyamer_security) · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-28372
- Category
- binary
- Affected product
- GNU inetutils telnetd
- Affected versions
- <= 2.7 (requires a util-linux login supporting login.noauth)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Tags
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | Rohitberiwala (Mohammed Idrees Banyamer, @banyamer_security) |
| CVE / Advisory | CVE-2026-28372 |
| Category | binary |
| Severity | High |
| CVSS Score | 7.4 (per repo README) |
| Status | PoC |
| Tags | telnetd, inetutils, lpe, new-environ, login-noauth, authentication-bypass, privilege-escalation, util-linux |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | GNU inetutils telnetd |
| Versions Affected | <= 2.7 (requires a util-linux login supporting login.noauth) |
| Language / Platform | Python 3 wrapper invoking the system telnet client / Linux |
| Authentication Required | Local-only (unprivileged local account) |
| Network Access Required | Yes (to the local/loopback telnetd service) |
Summary
GNU inetutils telnetd forwards client-controlled environment variables — negotiated via the Telnet NEW-ENVIRON option — to the login(1) process it spawns without adequately sanitizing them. On systems where the installed login (from util-linux) supports a CREDENTIALS_DIRECTORY-relative login.noauth marker file, an attacker can set CREDENTIALS_DIRECTORY to a directory they control and place a login.noauth file containing yes in it. When telnetd invokes login, it trusts this untrusted, attacker-supplied directory and treats the session as pre-authenticated, granting a root shell without a valid password. The PoC automates creation of the malicious directory/marker file and connects to telnetd with the crafted environment variable to demonstrate the bypass.
Vulnerability Details
Root Cause
telnetd passes client-supplied NEW-ENVIRON variables (including CREDENTIALS_DIRECTORY) through to login(1) without validating that the value originates from a trusted source, allowing an attacker-controlled directory containing a login.noauth marker to be treated as an authoritative “already authenticated” signal.
Attack Vector
- Create a local, attacker-writable directory containing a file named
login.noauthwith contentsyes. - Connect to the local telnetd service using the Telnet
NEW-ENVIRONoption to injectCREDENTIALS_DIRECTORYpointing at that attacker-controlled directory. telnetdinvokeslogin(1), which reads the untrustedCREDENTIALS_DIRECTORY/login.noauthmarker and bypasses password authentication, granting a root shell.
Impact
An unprivileged local user (or anyone able to reach the telnetd service) can escalate to root without valid credentials, resulting in full local privilege escalation.
Environment / Lab Setup
Target: Linux host running GNU inetutils telnetd <= 2.7, paired with a util-linux login supporting login.noauth
Attacker: Python 3, system `telnet` client binary, local/loopback network access to the telnetd service
Proof of Concept
PoC Script
See
exploit.pyin this folder.
| |
The script creates a temporary directory with a login.noauth marker file, sets CREDENTIALS_DIRECTORY to that directory in the environment, and invokes the system telnet client with NEW-ENVIRON options against the target telnetd, triggering the authentication bypass. Note: the shipped exploit.py invokes TelnetdExploit().run() under a guard with a typo (if name == "__main__": instead of if __name__ == "__main__":), so it must be run via python3 -c "from exploit import TelnetdExploit; TelnetdExploit().run()" or with the guard corrected before the automated trigger fires.
Detection & Indicators of Compromise
Signs of compromise:
- telnetd sessions that reach a root shell without a corresponding password prompt/entry in auth logs.
CREDENTIALS_DIRECTORYenvironment values referencing non-standard, world-writable, or temporary directories.- Unexpected
login.noauthfiles present on the filesystem outside systemd-managed credential paths.
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor for advisory |
| Interim mitigation | Disable telnetd entirely in favor of SSH; if telnetd must remain, strip/ignore client-supplied CREDENTIALS_DIRECTORY and other sensitive NEW-ENVIRON variables before invoking login(1). |
References
Notes
Mirrored from https://github.com/Rohitberiwala/CVE-2026-28372 on 2026-07-05.
| |