maxcountryman / maxcountryman/flask-bcrypt

Flask-Bcrypt not working with latest version of Bcrypt

Open
#89 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
327
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Bcrypt just release new version 4.0.0 https://pypi.org/project/bcrypt/#history on August 24th and your module will not work with this version. I think fixed bcrypt version at 3.2.0 or below 4.0.0 will prevent an error happens like we had.

File "/usr/local/lib/python3.6/site-packages/flask_bcrypt.py", line 193, in check_password_hash
return safe_str_cmp(bcrypt.hashpw(password, pw_hash), pw_hash)
File "/usr/local/lib/python3.6/site-packages/bcrypt/__init__.py", line 84, in hashpw
return _bcrypt.hashpass(password, salt)
TypeError: argument 'salt': 'bytearray' object cannot be converted to 'PyBytes'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure in flask_bcrypt.py at check_password_hash with bcrypt 4.0.0, using the traceback as the entry point. Compare the supported bcrypt versions and verify that the chosen compatibility fix prevents the bytearray/PyBytes error without breaking password verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
backend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.