I was surprised that the out of the box \'W\' command on Linux provides so much
ID: 657080 • Letter: I
Question
I was surprised that the out of the box 'W' command on Linux provides so much information without needing any SUDO or admin permissions. In particular, the command shows the command line of each user's current process. This seems to be a huge hole as it could potentially show someone accessing a hidden file (for instance, the command 'vim .ProofThatTheMoonLandingWasFaked.txt'), plain text passwords (yes, I know that should never be an issue since plaintext passwords should never be entered but it still comes up), etc.
Does the out of the box 'W' command constitute a security hole in a system?
Explanation / Answer
w, by itself, isn't what lets you do this; it doesn't have any sort of elevated privileges, and everything it can do is something you could already do yourself. The actual thing that lets you see other users' processes is that process info is stored in the /proc/ directory, and all users have access to the /proc/[pid] directories that store individual process info.
If the question is instead "isn't /proc being world-readable a security hole," the answer is "a security hole according to what threat model?" Security holes are when someone can do something that they shouldn't be able to do. Many Unix-based systems (this behavior predates Linux) don't consider things like command line options and who's running each process to be sensitive information; making this world-readable was an intentional decision that it was not something that needed to be restricted. This behavior might be good or bad depending on your needs, but the point is that unless it's a problem on your system it's by definition not a security hole.
If you often enter passwords on a command line (that presumably you don't want other users to see), or if you don't want users to see what other users are doing, then this is a security issue, because then it lets people do something they shouldn't be able to do. On Linux, being Linux, you can modify this behavior and restrict /proc. If, like the designers of most of these systems, you don't see an issue with people seeing what programs others are executing, then this isn't a hole. Traditionally, that's not an issue, so most systems allow this access.
(For hidden files: They aren't actually a security feature at all; the reason they exist is convenience. Anyone who can list files in a directory can list all files, including hidden ones).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.