OS/400 SysReq Security Exposure
Q: I recently read on Securityfocus.com that OS/400 has a security problem that was reported to Bugtraq. According to the report, any user can get a list of all of the user profile objects through the use of the SysReq menu. Do you know anything about this exposure? Can you tell me if I need to be worried about it?
A: It's very unusual for OS/400 issues to appear on the Bugtrac list, so this one caught my eye as well. The essence of the alleged exposure is that a user could use the SysReq menu to display their own job and then, from the DSPJOB menu, choose to display library lists. Once there, the user could display the contents of library QSYS, including the names of user profile objects that they are not otherwise authorized to. (See the Securityfocus report at http://online.securityfocus.com/bid/4059.)
In order to exploit this anomaly, the user must already be signed on to your iSeries and must have access to the SysReq menu. In this case, the user can then see the names of all of your user profiles. This is not desirable, but neither is it a crisis. From my perspective, the security exposure is not so much that a user can see the names of other user profiles; I am more concerned with the larger concept: that a user can see and verify the existence of any object that they are *EXCLUDED from if they simply have *USE authority to the library that those objects live in. If this is not a shortcoming of security, it is at least an inconsistent application of security. If a user issues the command WRKOBJ FRED from a command line, they will not see any object named FRED in their library list if their authority to those objects is *EXCLUDE. Yet, if the same user accesses a "list library" procedure, they will be eligible to see--and verify the existence of--all of the objects (not just user profiles) named FRED in that library, regardless of their authority to those objects.
What this tells me is that you cannot conceal the existence of an object from a user if the object exists in a library the user has *USE authority to. If you have a business reason to conceal the existence of objects from certain users, you'll need to put that object in a library that those users have *EXCLUDE authority to. Of course, this is not possible for user profiles because they all live in library QSYS, and a user must have *USE rights to QSYS to use OS/400. But, as several IBMers have pointed out to me, you can see the same thing on UNIX systems by typing commands such as "cat /etc/passwd | scroll," so they feel that OS/400 is being unfairly singled out for an exposure that UNIX allows.
So is this something to worry about? That depends on how well you manage the user profiles on your system. If you make a regular practice of expiring old profiles, preventing users from using default passwords, and enforcing password rules that make passwords difficult to guess, the impact of this security anomaly will be negligible. But if you are inattentive to the problem of old and unguarded user profiles, then allowing users access to the list of other users could be a serious exposure.
Just last week, I was visiting a business partner to demonstrate our software, and while I was there, the president of the company invited me to try to gain access to their system. While he was quite confident in his security at the start of the session, by the end of the demonstration, there were a lot of embarrassed laughs and sheepish looks being cast sideways among the business partner technicians. My exploit? Simple, really. I acquired a list of user names and then endeavored to try the default passwords for a couple that looked like testing or training profiles. I hit pay dirt on the first try, and in just a few seconds was logged onto the system with a testing profile. In no time at all, I was able to traipse across production applications and download production files.
There are lots of ways to get lists of users on a given system. Having the list is valuable to a hacker only if the underlying user profile security is weak.
To keep user profile security strong, you should perform these OS/400 commands on a regular basis:
- Use the Analyze Default Passwords (ANZDFTPWD) command to display a list of user profiles whose passwords are the same as the user profile name.
- Look for old, unused profiles by issuing the Print User Profile (PRTUSRPRF) command and specifying *PWDINFO on the Type parameter. Then scan the "last signed on" date to see which profiles are unused.
In addition, make sure that your password system values are set to require strong passwords. Here are the password system values to pay particular attention to (along with some recommended settings):
- QPWDEXPITV--Password Expiration Interval
Maximum 60 days
- QPWDMINLEN--Password Minimum Length
- QPWDRQDDGT--Require at least one digit in password
- QPWDRQDDIF--Require this password to be different from the last N passwords.
Set it to at least 10.
If you want to tighten up the particular exposure you wrote to me about, you have a couple of different options. The Securityfocus Web site recommends either securing the SysReq panel group itself so that the user cannot access the SysReq menu (Example: RVKOBJAUT OBJ(QSYS/QGMNSYSR) OBJTYPE(*PNLGRP) USER(user-id) AUT(*ALL) ) or securing the DSPLIB command (Example: RVKOBJAUT OBJ(QSYS/DSPLIB) OBJTYPE(*CMD) USER(*PUBLIC) AUT(*ALL) ) so that the user cannot display a library.
Be cautioned, however, that revoking authority to the DSPLIB command is not an effective block to this exposure because the Display Library option on the DSPJOB command does not use the DSPLIB command.
If you're looking for a more strategic method of securing this exposure, consider editing the SysReq message description to eliminate the DSPJOB capability. Message description QSYS/QCPFMSG CPX2313 contains the commands that are executed by the SysReq menu. If you replace the "DSPJOB" string with a string such as "NULLCMD" and then create a command called NULLCMD that does nothing, this would prevent all users from using the SysReq menu to view their jobs (and eventually their library lists).
Keep Users from Adding Files to Libraries
Q: I have a series of production libraries that my users access from both RPG programs and from the Web. I want the users to be able to read and update files in those libraries, but I don't want them to create new files (or other objects) in those libraries. Is there a way to get this done?
A: Actually, this is quite easy, and OS/400 is well-positioned to get the job done. In order to create a file (or any other object) in a library, the user must have Data Add rights to the library object itself. If you perform the EDTOBJAUT authority against the library and then remove the "X" under the ADD column in the object authority screen for the library in question, the user(s) in question will no longer be able to create new objects in the library. Assuming that you do not revoke their ability to "*USE" the library, this change will not affect their ability to work with objects in the library.
A word of caution is in order. Though the absence of the Data Add authority column on a library will prevent a user from adding a new object into a library, the absence of the Data Delete authority column will not prevent a user from deleting an object from a library. In order to delete an object from a library, the user only needs *USE authority to the library (and of course *OBJEXST to the object being deleted). If you want to prevent the deletion of objects, you must secure those objects at the object level and not rely on the library level to protect you.
Q: Recently, the owner's son, through the use of some "sniffer" software, was able to capture the userids and passwords of several people as they signed onto the AS400. He was running this software from a PC attached to the same LAN to which the AS400 and all of the users are attached: Windows NT network. If he can do this, so can someone else! How do I prevent this?
A: The problem with clear-text passwords on OS/400 is a well-known flaw in the DDS sign-on screen QDSIGNON. The root of the problem is that DDS is not able to provide, or even recognize, encrypted text. Therefore, any text that is typed into a DDS screen would not be encrypted unless the entire communication session is encrypted through the use of some lower-level encryption technology, such as a VPN.
The obvious solutions are either to encrypt the entire session (using VPN or SSL) or to not require your users to enter passwords in DDS. The second suggestions is not as crazy as it sounds. If you're using IBM Client Access, the Client Access sign-on function (the little blue and gray window) will encrypt profiles and passwords before they are sent to the AS/400. If you configure the Client Access program to Bypass Signon (meaning that the DDS screen is bypassed) and configure the AS/400 system value QRMTSIGN to *VERIFY, then users will only have to sign on at the little window, and passwords will not be sent to DDS in the clear.
From a security perspective, DDS is a mess. I would avoid typing sensitive information into a DDS screen whenever possible.
Capture Unauthorized Access Attempts
Q: I need to be able to tell when someone tries to access a file or a program that they are not authorized to. I have the authority set up correctly on the objects, but I never get any messages. How can I tell if it is working?
A: The Security Audit Journal (QAUDJRN) can record all attempts to access an object without proper authority. To accomplish this, first ensure that the system value QAUDCTL is set to (at least) *AUDLVL and the system value QAUDLVL includes the value *AUTFAIL. Once these settings are in place, the security audit journal will record invalid access attempts in the QAUDJRN receivers. These entries will bear the journal code of "T" and the journal type of "AF." You can either pull these entries out of the journal with a homegrown query or purchase a more sophisticated auditing tool that was built for this task.