Pre-auth RCE in tac_plus via a format string
Attack Techniques & Methods2026-10-05, 09:00
TACACS+ is an AAA protocol that large networks use to centralize administrative access: devices ask a server over TCP/49 for permission to log in and for each command, so a server in that position sees administrative credentials for the entire fleet in close to real time. It was in this very component—the
tac_plus daemon, code from Cisco's early-90s Developer's Kit, that Matt Jones of Elttam found a pre-authentication format string vulnerability allowing code execution with the daemon's privileges, which by default means root.• Where the bug is located — the vulnerability was found in the
send_authen_error() function in packet.c. The attacker controls the port field in AUTHEN/START. On an authentication error, the function builds an “IP port: message” string and passes it to report() as a format string, after which it reaches vsnprintf(). %x in port reads the daemon's stack, while %n writes to memory. One nuance: %x values are written to the daemon's log rather than returned to the attacker—the client still receives the format specifiers unchanged. The %n write is blind. Shrubbery contains a second, similar sink in get_authen_continue().• How the PoC works: two passwordless packets — exploitation requires neither credentials nor prior traffic. The attacker connects to TCP/49 and sends:
- A valid AUTHEN/START with a format-string payload in the
portfield. - An intentionally malformed continuation packet (AUTHEN/CONT), which sends the daemon into the
send_authen_error()error path. At this point, thesend_authen_error()function callsreport(), which passessession.porttovsnprintf()as a format string. In a lab environment, Elttam demonstrated code execution on a 32-bit build without memory protections enabled by overwriting the Global Offset Table entry forfree().
• PSK oracle: how to bypass obfuscation without knowing the key: when TACACS+ obfuscation is enabled, an additional challenge arises—delivering a correctly obfuscated payload to the server. Elttam therefore investigated the PSK oracle separately. The body of each TACACS+ packet is obfuscated with an MD5 stream XORed with the pre-shared key (PSK), but integrity is not verified and there is no authenticated encryption. Elttam showed that the PSK becomes an oracle: a truncated AUTHEN/START triggers a predictable error response obfuscated with the same key. An attacker can use the response as a key-verification oracle, testing candidate PSKs offline to recover a weak key—without intercepted traffic or valid credentials.
• Using a trusted client as an obfuscator: beyond the management network — this is the only path that does not require access to TCP/49. The attacker only needs network access to the login form of a device using TACACS+. The device is a legitimate client; it stores the key and performs the obfuscation for the attacker. The length fields in AUTHEN/START are one byte long, so if the device truncates an overly long username instead of rejecting it, the server parses the packet at the wrong boundary and reads the of the username as subsequent fields, including
port. The format string embedded in the remaining bytes then reaches session.port already correctly encrypted—without knowledge of the shared secret.• Affected versions — the vulnerability is present in Cisco's original Developer's Kit and in all Shrubbery releases up to F4.0.4.31 (February 2026).
Any project that inherited code from the Developer's Kit also inherited the bug, and TACACS+ is present in network devices from dozens of vendors, most of which have not disclosed which codebase they used as their starting point. Cisco PSIRT, however, stated that Cisco products do not use this code.
Vendors
Products