Weak encryption algorithm (RC4) used for password detected.
- Rule ID: javascript_lang_weak_password_encryption_rc4
- Languages: javascript
- Source: weak_password_encryption_rc4.yml
Description
According to OWASP, RC4 is considered a weak encryption algorithm and therefore shouldn't be used.
Moreover, since encryption is reversible, it is possible to retrieve the plaintext value. This makes encryption a bad choice for passwords. Instead, passwords should be hashed.
Remediations
❌ Do not use encryption for passwords, wherever possible.
✅ Use a recommended hashing library such as Argon2id for passwords
const argon2 = require("argon2");
const hash = await argon2.hash(req.params.password, { type: argon2.argon2id })
Resources
Associated CWE
OWASP Top 10
Configuration
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=javascript_lang_weak_password_encryption_rc4
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=javascript_lang_weak_password_encryption_rc4
Ready to take the next step? Learn more about Bearer Cloud.