=============================================================================== Security Advisory CERT-NL =============================================================================== Author/Source : CERT-NL (Rene Ritzen) Index : S-94-15 Distribution : World Page : 1 Classification: External Version: Final Subject : Vulnerability in IBM and Linux /bin/login Date : 24-May-94 =============================================================================== CERT-NL received information on a vulnerabilty in IBM AIX and Linux. CERT-NL wishes to thank NASIRC for providing this information. ---------------------------------------------------------------------------- CERT-NL recently received information about a security vulnerability in /bin/login on machines running the AIX or LINUX operating systems. NOTE -- The commands necessary to exploit these vulnerabilities have already been posted to several Usenet newsgroups; CERT-NL recommends that the fix(es) described below be applied immediately. SYSTEMS AFFECTED: All machines running AIX version 3.2.X or any version of the LINUX operating system. At the time of this writing, ARPA/CERT has received feedback from the following vendors indicating that their products are NOT vulnerable: Amdahl; Apple; BSD; BSDI; Harris; H-P; Motorola; NeXT; Pyramid; SCO; SGI; Solbourne; Sony; and Sun. In addition, ARPA/CERT has verified that the product "Free BSD" is NOT vulnerable. THE PROBLEM: According to several Usenet postings, any user can gain a root shell on AIX and LINUX systems by issuing the command "tprof -x /bin/sh". Additionally, non-privileged users on the system can gain root access by using the "-f" option in login (if login is setuid root) if they type "-froot" instead of their username at the login prompt. Lastly, remote users can gain root access through rlogin by using the "-l" and "-f" options with the command "rlogin n.n.n.n -l -froot". THE FIX: For AIX v3.2.X: --------------- Until IBM's official long-term fix becomes available (see below), we recommend you do the following to disable the rlogin daemon: 1) As root, edit /etc/inetd.conf and comment out the line "login ... rlogin" 2) Run "inetimp" 3) Run "refresh -s inetd" IBM has issued an emergency fix for the different levels of AIX 3.X affected by the vulnerability; it is available via anonymous FTP as follows: ftp://ftp.nic.surfnet.nl/surfnet/net-security/cert-nl/patches/ibm-fixes/rlogin.tar.Z. The checksum information for rlogin.tar.z is as follows: BSD System V MD5 --------- --------- -------------------------------- 25285 317 13021 633 803ee38c2e3b8c8c575e2ff5e921034c IBM's long-term fix (still under development) can be ordered as APAR IX44254. To order an APAR from IBM contact your local IBM representative and ask them to ship it as soon as it is available. According to IBM, this fix will be available in approximately two weeks. As a possible alternative to completely disabling the rlogin daemon, NASIRC has developed a workaround that will instead disable only the "-f" flag: 1) Move /bin/login to a new name (e.g., /bin/login_hides_here) and remove the set-uid bit. 2) Compile the following program and install it as /bin/login with set-uid on: main(argc, argv) unsigned argc; char *argv[]; { register char **ap; for (ap = argv; *ap; ap++) if (strncmp(*ap, "-f", 2) == 0) { *ap = (char *)0; } execv("/bin/login_hides_here", argv); } For LINUX: ---------- A patch for the REMOTE access vulnerability, comprised of the files "security.tgz" and "README.security", is available via anon FTP from ftp.nic.surfnet.nl as follows: ftp://ftp.nic.surfnet.nl/surfnet/net-security/cert-nl/patches/linux-fixes/* The checksum information is as follows: BSD System V MD5 --------- --------- -------------------------------- security.tgz 32878 257 40797 513 dd4585cf4da1b52d25d619bf45f55b75 README.security 09575 1 20945 1 41d14d7b8725c7a1015adeb49601619b NOTE: "security.tgz" includes other security fixes in addition to the /bin/login patch. To fix the LOCAL access problem, CERT-NL encourages installation of a version of /bin/login that does not allow the "-f" option in the form of "-f". The recommended version should only allow this option in the form "-f ", with a space to indicate two arguments. If you find a version of Linux that contains the local access vulner- ability, please contact CERT-NL should you require assistance. CERT-NL will continue to monitor this situation and will post additional information should it become necessary. If you have any questions about this bulletin, please contact CERT-NL via any of the venues below. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= CERT-NL ACKNOWLEDGES: Axel Clauberg and Claus Kalle of the University of Cologne and Gerhard Rentschler of Stuttgart University for the initial reporting of this vulnerability to the Internet community. CERT-NL also acknowledges the ARPA/CERT for their rapid liaison with the vendor com- munity to identify the vulnerabilities in other forms of UNIX. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ============================================================================== CERT-NL is the Computer Emergency Response Team, located in The Netherlands. CERT-NL is a Full Member of the Forum of Incident Response and Security Teams (FIRST). The constituency of CERT-NL are the SURFnet connected institutions. Past CERT-NL Security Bulletins and other CERT-NL related material can be found on the anonymous FTP server of SURFnet bv: "ftp.nic.surfnet.nl" [192.87.46.3], in the directory "surfnet/net-security/cert-nl/docs/bulletin". This information is also available using email. Send an email saying "help" to "mailserv@nic.surfnet.nl". In case of computer or network security problems please contact CERT-NL or the CERT of your own constituency. Please be aware of the fact that we are one (when DST is in effect two) hour(s) ahead of Universal Time Coordinated (i.e. UTC+0100 (UTC+0200)). Email: cert-nl@surfnet.nl Phone: +31 30 310290 Fax: +31 30 340903 Snailmail: SURFnet bv Attn. CERT-NL P.O. Box 19035 NL - 3501 DA UTRECHT The Netherlands A 7 * 24 hours phone number is available to SURFnet SSC's and FIRST members on request. ============================================================================== ----------------------------------------------------------------------------- Rene Ritzen, Dep. of Telecommunications | Phone : +31 30 533785 Academic Computer Centre Utrecht (ACCU) | Fax : +31 30 531633 P.O. Box 80011 | E-mail: R.Ritzen@cc.ruu.nl 3508 TA Utrecht | X.400 : G=Rene;S=Ritzen; the Netherlands | OU=cc;O=ruu;PRMD=surf | ADMD=400net;C=nl -----------------------------------------------------------------------------