Usage of weak hashing library (CRC32)

Description

While CRC32 can give a quick assurance of integrity it provides little protection against intentional alteration of data.

Remediations

❌ Avoid algorithms with known weaknesses:

  $myhash = crc32($input)

✅ Use stronger hashing algorithms.

  $myhash = hash('sha256', $input)

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=php_lang_weak_hash_crc32

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

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