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

Increase password hashing iterations #1149

Merged
merged 9 commits into from
Sep 4, 2022
Merged

Conversation

LoicPoullain
Copy link
Member

@LoicPoullain LoicPoullain commented Sep 3, 2022

Issue

Latest OWASP guidelines recommend to have a work factor for PBKDF2 of 310,000 iterations when HMAC-SHA256 hashing algorithm is used. The iterations in hashPassword thus must be increased.

Source: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2

Solution and steps

  • Increase password hashing iterations.
  • Add a new function passwordHashNeedsToBeRefreshed.
  • Add an example on how to use passwordHashNeedsToBeRefreshed in a log in controller.

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

@LoicPoullain LoicPoullain added this to Work In Progress in Issue tracking via automation Sep 3, 2022
@LoicPoullain LoicPoullain mentioned this pull request Sep 3, 2022
1 task
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2022

Codecov Report

Merging #1149 (7fcdf3a) into v2-11-0 (71e5a18) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           v2-11-0    #1149      +/-   ##
===========================================
+ Coverage    98.94%   98.96%   +0.01%     
===========================================
  Files           96       99       +3     
  Lines         1712     1731      +19     
  Branches       404      410       +6     
===========================================
+ Hits          1694     1713      +19     
  Misses          18       18              
Impacted Files Coverage Δ
.../core/src/core/routes/convert-error-to-response.ts 100.00% <ø> (ø)
packages/core/src/index.ts 0.00% <ø> (ø)
...es/core/src/common/auth/passwords/hash-password.ts 100.00% <100.00%> (ø)
packages/core/src/common/auth/passwords/index.ts 100.00% <100.00%> (ø)
...h/passwords/password-hash-needs-to-be-refreshed.ts 100.00% <100.00%> (ø)
.../passwords/utils/decompose-pbkdf2-password-hash.ts 100.00% <100.00%> (ø)
...ages/core/src/common/auth/passwords/utils/index.ts 100.00% <100.00%> (ø)
.../core/src/common/auth/passwords/verify-password.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@LoicPoullain LoicPoullain merged commit b75c444 into v2-11-0 Sep 4, 2022
@LoicPoullain LoicPoullain deleted the password-iterations branch September 4, 2022 19:03
Issue tracking automation moved this from Work In Progress to Done / Closed This Release Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

None yet

2 participants