Usage of weak hashing library (Adler-32)
- Rule ID: php_lang_weak_hash_adler32
- Languages: php
- Source: weak_hash_adler32.yml
Description
Adler-32 is a weak hashing algorithm that offers minimal security. It is not suitable for protecting data against intentional modifications.
Remediations
- Do not use Adler-32 for hashing when security is a concern. Its simplicity and speed do not compensate for its lack of protection against data tampering.
$myhash = hash('adler32', $input); // unsafe
- Do opt for stronger hashing algorithms like SHA-256 to ensure data integrity and security.
$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_adler32
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=php_lang_weak_hash_adler32