Usage of weak encryption algorithm (RC4)

Description

A weak encryption library can lead to data breaches and greater security risk.

Remediations

According to OWASP, RC4 (Rivest Cipher 4) is considered a weak encryption algorithm and therefore shouldn't be used.

✅ Use stronger encryption algorithms when storing data.

const crypto = require("crypto");

const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);

const encrypted = cipher.update("my secret message", "utf8");

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_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_encryption_rc4