Setting unsafe POSIX file permissions can be insecure and can lead to unintended access to files.
In Unix, the "others" class refers to all users except the owner of the file and the members of the group assigned to this file. Granting permissions to this group of users can lead to unintended access to files.
const fs = require('fs');
const process = require('process');
fs.chmodSync("/tmp/fs", 0o777); // Sensitive
// ...
})
process.umask(0o777); // Sensitive
const fs = require('fs');
const process = require('process');
fs.chmodSync("/tmp/fs", 0o770); // Compliant
// ...
})
process.umask(0o770); // Compliant