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.
The most restrictive possible permissions should be assigned to files and directories.
chmod("foo", 0777); // Noncompliant
umask(0); // Noncompliant umask(0750); // Noncompliant
chmod("foo", 0750); // Compliant
umask(0027); // Compliant
The most restrictive possible permissions should be assigned to files and directories.
use Illuminate\Filesystem\Filesystem;
$fs = new Filesystem();
$fs->chmod("foo", 0777); // Noncompliant
use Illuminate\Filesystem\Filesystem;
$fs = new Filesystem();
$fs->chmod("foo", 0750); // Compliant
The most restrictive possible permissions should be assigned to files and directories.
use Symfony\Component\Filesystem\Filesystem;
$fs = new Filesystem();
$fs->chmod("foo", 0777); // Noncompliant
use Symfony\Component\Filesystem\Filesystem;
$fs = new Filesystem();
$fs->chmod("foo", 0750); // Compliant