NASIRC BULLETIN #94-22 May 23, 1994 Login-Related Security Vulnerabilities in AIX and LINUX =========================================================== __ __ __ ___ ___ ____ ____ /_/\ /_/| /_/ / _/\ /_/| / __/ \ / __/\ | |\ \| || / \ \ | /\/ | || | /\ \/ | | \/ | ||\ \ || / /\ \ \ \ \ | || |_\/ /\ | | | || \ \|| / /--\ \ \ /\_\\ | || | |\ \ \ | \_/\ |_|/ \_|//_/ \_\/ \/__/ |_|/ |_| \_\/ \___\/ NASA Automated Systems Incident Response Capability =========================================================== NASIRC 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; NASIRC 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://software.watson.ibm.com/pub/rlogin/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 in the USA, call 1-800-237-5511 and ask IBM to ship it as soon as it is available. According to IBM, this fix will be available in approximately two weeks. APARs may be obtained outside the USA by contacting your local IBM representative. NASIRC will attempt to obtain this APAR and make it available via our online archive. 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 sunsite.unc.edu as follows: ftp://sunsite.unc.edu/pub/Linux/system/Network/sunacm/URGENT/* 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. Checksum information for security.tgz is located at the end of this bulletin. To fix the LOCAL access problem, NASIRC 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 NASIRC should you require assistance. NASIRC 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 NASIRC via any of the venues below. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= NASIRC 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. NASIRC also acknowledges the ARPA/CERT for their rapid liaison with the vendor com- munity to identify the vulnerabilities in other forms of UNIX. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =============================================================== For further assistance, please contact the NASIRC Helpdesk: Phone: 1-800-7-NASIRC Fax: 1-301-441-1853 Internet Email: nasirc@nasa.gov 24 Hour/Emergency Pager: 1-800-759-7243/Pin:2023056 STU III: 1-301-982-5480 =============================================================== This bulletin may be forwarded without restriction to sites and system administrators within the NASA community. The NASIRC online archive system is available via anonymous FTP from nasirc.nasa.gov. You will be required to enter your valid e-mail address as the "password". Once on the system, you can access the following information: ~/bulletins ! contains NASIRC bulletins ~/information ! contains various informational files ~/toolkits ! contains automated toolkit software The contents of these directories is updated on a continuous basis with relevant software and information; contact the NASIRC Helpdesk for more information or assistance. ----------------- PLEASE NOTE: Users outside of the NASA community may receive NASIRC bulletins. If you are not part of the NASA community, please contact your agency's response team to report incidents. Your agency's team will coordinate with NASIRC, who will ensure the proper internal NASA team(s) are notified. NASIRC is a member of the Forum of Incident Response and Security Teams (FIRST), a world-wide organiza- tion which provides for coordination between incident response teams in handling computer-security-related issues. You can obtain a list of FIRST member organizations and their constituencies by sending email to docserver@first.org with an empty "subject" line and a message body containing the line "send first-contacts".