cloudflare / cloudflare/workerd
crypto: 100,000 iterations of PBKDF2 is insecure
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
Hello,
`workerd` (and Cloudflare Workers) limits the number of `PBKDF2` iterations to 100,000 to avoid DoS.
We can see the code here: https://github.com/cloudflare/workerd/blob/d1a3c89716591753406923e177b54da3475dd01c/src/workerd/api/crypto-impl-pbkdf2.c%2B%2B#L45C31-L45C37
While I understand the reason, especially in a multi-tenant environment like Cloudflare Workers, 100,000 iterations is far from secure, as per [OWASP guidelines](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html), which, in 2023, recommends at least 210,000 iterations for `PBKDF2-SHA-512` and 600,000 iterations for `PBKDF2-SHA-256`, making any application hashing passwords from Cloudflare Workers insecure.
This is why I'm requesting an increase to at least 400,000 iterations.
Contributor guide
Assessment
This issue has not been assessed yet.