
CVE-2026-24061: An 11-Year-Old Telnet Bug That Grants Instant Root
Old protocols never really die - they just wait patiently for us to forget how dangerous they can be.
In early 2026, CVE-2026-24061 dropped with a CVSS score of 9.8, exposing a critical remote authentication bypass in `telnetd` that had been hiding in plain sight for 11 years. The vulnerability allows an attacker to obtain an instant root shell by abusing unsanitized environment variables and legacy login behavior.
This post breaks down what happened, how it works, and - perhaps most interestingly - how something this severe survived undetected for more than a decade.
The Vulnerability at a Glance
- CVE: CVE-2026-24061
- Component: `telnetd` / login template handling
- Impact: Authentication bypass → root access
- Attack Vector: Network (unauthenticated)
- CVSS v3.1: 9.8 (Critical)
A single command is enough:
USER="-f root" telnet -a <target_ip> 23If the service is vulnerable, the attacker is dropped directly into a root shell with no password prompt.
The 2015 Commit That Started It All
The root cause traces back to a 2015 commit that introduced dynamic username handling in the telnet login template. The goal was convenience: enable auto-login support by dynamically passing the username.
The template looked like this:
/usr/bin/login -p -h %h %?u{-f %u}{%U}At first glance, this seems harmless - even helpful. But the devil lives in the details.
RFC 1572: A Forgotten Footgun
According to RFC 1572, Telnet clients are allowed to send environment variables to the server - including `USER`.
Critically:
- These variables are sent before authentication
- They are completely unsanitized
- Telnetd historically trusted them
That trust turned out to be catastrophic.
From Environment Variable to Root Shell
Here’s where everything comes together:
- The attacker sets the environment variable:
USER="-f root" - Telnet sends this variable verbatim to the server.
- The login template expands `%U` using the attacker-controlled value.
- The executed command becomes:
/usr/bin/login -p -h <host> -f root - The `-f` flag tells `login`:
“This user has already been authenticated elsewhere - skip password verification.”
- Result: root login without credentials.
No brute force. No exploit chain. No memory corruption. Just a string.
Why `-f` Is So Dangerous
The `-f` option exists for legitimate reasons:
- Used by display managers
- Used by trusted authentication flows
- Intended for already authenticated contexts
But when exposed to user-controlled input, it becomes an authentication bypass of the highest order.
This bug isn’t about telnet being insecure in theory - it’s insecure in practice, because it was never designed with modern threat models in mind.
How Did This Survive for 11 Years?
This is the most fascinating part of the story. Several factors helped this bug remain invisible:
1. Telnet Is “Legacy”
Most security researchers simply stopped looking at telnet years ago. SSH replaced it, and attention moved on.
2. The Code Change Looked Innocent
The 2015 commit added flexibility, not new parsing logic. No alarms were triggered.
3. Trust in Standards
RFC-compliant behavior (environment variable passing) was assumed safe - because it always had been.
4. Rarely Exposed in Modern Setups
Many systems:
- Disable telnet by default
- Bind it to internal networks
- Use PAM setups that masked the issue
But not all of them.
Real-World Impact
Any system that:
- Runs `telnetd`
- Uses the vulnerable login template
- Is reachable over the network
…is trivially compromisable.
This includes:
- Embedded devices
- Legacy appliances
- Industrial systems
- Forgotten admin interfaces
In environments like OT, ICS, and old enterprise infrastructure, telnet is still alive.
Mitigation and Recommendations
Immediate Actions
- Disable telnetd entirely if possible
- Patch immediately if telnet must remain enabled
- Audit for exposed TCP/23 services
Long-Term Lessons
- Legacy protocols deserve more scrutiny, not less
- Convenience features are attack surfaces
- “Trusted” inputs age badly
If something hasn’t been reviewed in a decade, assume it’s vulnerable.
Final Thoughts
CVE-2026-24061 is a perfect example of why security bugs aren’t always clever - sometimes they’re just forgotten.
A single string, passed through an old protocol, into a trusted binary, unlocked full root access for over a decade.
Old protocols hide the craziest bugs.
And telnet just reminded us why it should stay dead.
