Usage of insufficient random value

Description

Using predictable random values makes our application vulnerable to attacks, especially if these values are used for security purposes.

Remediations

✅ Use a stronger library when generating random values

const crypto = require('crypto');
crypto.randomBytes(16).toString('hex');

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_insufficiently_random_values

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=javascript_lang_insufficiently_random_values