JS: Fix qhelp after file rename#12741
Conversation
|
QHelp previews: javascript/ql/src/Security/CWE-916/InsufficientPasswordHash.qhelpUse of password hash with insufficient computational effortStoring cryptographic hashes of passwords is standard security practice, but it is equally important to select the right hashing scheme. If an attacker obtains the hashed passwords of an application, the password hashing scheme should still prevent the attacker from easily obtaining the original cleartext passwords. A good password hashing scheme requires a computation that cannot be done efficiently. Standard hashing schemes, such as RecommendationUse a secure password hashing scheme such as ExampleIn the example below, the const crypto = require("crypto");
function hashPassword(password) {
var hasher = crypto.createHash('md5');
var hashed = hasher.update(password).digest("hex"); // BAD
return hashed;
}This is not secure, since the password can be efficiently cracked by an attacker that obtains the hash. A more secure scheme is to hash the password with the const bcrypt = require("bcrypt");
function hashPassword(password, salt) {
var hashed = bcrypt.hashSync(password, salt); // GOOD
return hashed;
}References
|
This broke in #12666 The qhelp probably needs a more substantial update, as an example has been added which is not referred to in the qhelp.