In Unix file system permissions, the "others" category refers to all users except the owner of the file system resource and the
members of the group assigned to this resource.
Granting permissions to this category can lead to unintended access to files or directories that could allow attackers to obtain sensitive
information, disrupt services or elevate privileges.
Ask Yourself Whether
- The application is designed to be run on a multi-user environment.
- Corresponding files and directories may contain confidential information.
There is a risk if you answered yes to any of those questions.
Recommended Secure Coding Practices
The most restrictive possible permissions should be assigned to files and directories.
To be secure, remove the unnecessary permissions. If required, use --chown to set the target user and group.
Sensitive Code Example
#!/bin/bash
# Sensitive
chmod +x resource
# Sensitive
chmod u+s resource
# Sensitive
chmod 0777 resource
Compliant Solution
#!/bin/bash
chmod u+x resource
chmod +t resource
chmod 0754 resource
See