Fedora Account System
Red Hat Associate
Red Hat Customer
Debian's patch series builds netkit telnetd with -DACCEPT_USERVAR. Patch 124-support_uservar.diff modifies the NEW-ENVIRON suboption handler in suboption() (telnetd/state.c) so that any variable the CLIENT marks as USERVAR is accepted and setenv()'d: if (envvarok(varp) || is_uservar) setenv(...); The client fully controls the is_uservar flag, so the envvarok() whitelist is bypassed. A remote, unauthenticated attacker can set arbitrary environment variables in the daemon process during the initial option negotiation, before startslave() forks the login child. The forked child inherits the poisoned environment, and the setuid-root telnetlogin wrapper forwards it verbatim to /bin/login (execve(_PATH_LOGIN, argv, envs) with envs = environ); it validates only the values of TERM and REMOTEHOST.