Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: weak bcrypt cost #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

burntcarrot
Copy link

Description

This checker detects the usage of bcrypt.GenerateFromPassword with a cost factor less than 10. The bcrypt algorithm is designed to be computationally expensive to protect passwords against brute-force attacks. A low cost factor reduces the computational effort, making it easier for attackers to crack passwords. This checker is flagged as a security warning to ensure bcrypt is configured with a sufficiently high cost factor.

Recommendations

Use a cost factor of 10 or higher when calling bcrypt.GenerateFromPassword. OWASP recommends a cost factor of at least 10, and it should be increased as computing power grows. Adjust the cost factor based on performance testing to ensure it provides adequate security without causing unacceptable delays.

References

  • OWASP Password Storage Cheat Sheet: Recommends a bcrypt cost factor of 10 or higher
  • CWE-916: Use of Password Hash With Insufficient Computational Effort: Describes the risk of using password hashes that are too easy to compute.

Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
globstar ⬜️ Ignored (Inspect) Visit Preview Feb 25, 2025 4:53pm

@burntcarrot burntcarrot changed the title go: weak scrypt cost go: weak bcrypt cost Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant