Custom implementation of a Digest class detected

Description

Implementing a custom Digest class manually is not advised as the process could lead to errors. Instead use a standard Digest algorithm such as SHA-256 or SHA-512.

Remediations

❌ Do not implement a custom Digest class by hand

✅ Choose a standard Digest algorithm as SHA-256, SHA-384, SHA-512, or SHA-512/256.

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

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

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

Ready to take the next step? Learn more about Bearer Cloud.