visit
For account validity, we've added a Security Vulnerability rule: - Account validity should be verified when authenticating users with PAM. It turns out that it's entirely possible for a user with an invalid account - one that is locked or expired - to authenticate successfully. As a utility writer, you need to verify both successful authentication and account validity. Otherwise, you could be letting in people who wish the organization harm, such as a former employee whose account has been disabled.
For setting permissions, we've added two new Security Hotspots rules. As a reminder, are a separate class of security-related issues. When we raise a Security Hotspot on your code, we're not saying there's definitely something wrong that you need to fix. What we're saying is that there's the potential for something to be wrong depending on the context of the code, and human review is needed. The Security Hotspot rules we've added for permission setting are:
Both of these rules revolve around thinking you've limited a process to a directory without actually accomplishing that. Theoretically, `chroot` changes the root directory of a process, thus "jailing" it away from the rest of the filesystem. But according to the description of S5802, 'many chroot function implementations don't modify the current working directory, thus the process still has access to unauthorized resources outside of the "jail"' if you don't also change your current working directory (`chdir`) to the new root directory.
So okay, let's say you `chdir` to the jail directory before you `chroot`. You're good, right? Not necessarily. `chdir` won't work if you don't have access to the directory. And that's what S5982 is about - making sure your `chdir` worked before you go any further. These new rules are available today in and on . Together, they'll help you write more secure *nix utilities and libraries, laying a strong foundation for the applications that will be built on top of them.Previously published at