A critical authentication bypass vulnerability in GNU InetUtils’ telnetd server allows remote attackers to gain root access without credentials by exploiting improper parameter sanitization.
GNU InetUtils versions 1.9.3 through 2.7 contain a high-severity authentication bypass vulnerability in the telnetd server that enables unauthenticated remote attackers to achieve full system compromise.
The flaw stems from insufficient input validation of the USER environment variable, which telnetd passes unsanitized to the login program running with root privileges.
An attacker can exploit this vulnerability by crafting a specially formatted USER environment variable containing “-f root” and sending it via the telnet client’s -a or –login parameter.
When telnetd receives this malicious input, it passes the string directly to the login utility, which interprets “-f” as a flag to bypass authentication granting immediate root access without requiring valid credentials.
Technical Mechanism
The vulnerability exists in the variable expansion logic within telnetd/utility.c, specifically in the _var_short_name() function.
When processing the login command template defined in telnetd/telnetd.c, the code blindly expands the %U parameter (corresponding to the USER environment variable) without sanitisation.
The template uses the format “PATH_LOGIN -p -h %h %?u{-f %u}{%U}”, which passes the user input directly to login with the -f flag.
The “-f” parameter in login(1) is designed to bypass authentication a feature intended for use by systems that have already verified user identity.
By injecting this flag through the unsanitized USER variable, attackers can manipulate the login process to recognize them as root automatically.
Proof of Concept
Exploitation requires minimal setup. An attacker can execute:
textUSER='-f root' telnet -a localhost
This simple command chain results in an immediate root shell without password entry, as demonstrated in the advisory’s practical example on Trisquel GNU/Linux 11.
The vulnerability was introduced on March 19, 2015, via commit fa3245ac in the inetutils repository and was included in the v1.9.3 release on May 12, 2015. All subsequent versions through 2.7 remain vulnerable unless patched.
According to Openwall, the GNU InetUtils development team recommends disabling telnetd entirely, as modern systems should use SSH instead.
Organizations currently running telnetd should immediately apply patches from commits fd702c02 and ccba9f748, which implement comprehensive variable sanitization to prevent similar attack vectors.
Network administrators should restrict telnet port access to trusted clients only and migrate services to SSH as the primary remote access mechanism.
The development team also suggests implementing custom login tools that explicitly reject the “-f” parameter.
Follow us on Google News, LinkedIn, and X to Get Instant Updates ancd Set GBH as a Preferred Source in Google.
