v26.4.24
v26.4.24
Limit the memory used by password hashing
Ory Kratos can now limit the memory that Argon2 and scrypt password hashing use at the same time. The limit covers hashing new passwords and verifying imported Argon2, scrypt, and Firebase scrypt hashes. It doesn't apply to bcrypt or PBKDF2.
The limit is off by default. To turn it on, set the new hashers.memory_limit key. When it is on, an operation that doesn't fit
waits up to 5 seconds for memory. If none becomes available, the login, registration, or settings request fails with
429 Too Many Requests and the client can retry.
For example, with hashers.argon2.memory: 128MB and hashers.memory_limit: 1GiB, Ory Kratos runs up to eight Argon2 operations
at once. To serve more concurrent password logins, increase the limit together with the memory available to Ory Kratos.
See Memory limit for password hashing for the configuration and the Prometheus metrics.
Stricter validation of imported Argon2 hashes
Argon2 hashes with an empty output are now rejected at import and at login.
To import an identity whose hash exceeds a limit, use the password migration hook. Your existing system verifies the password the first time the user signs in, and Ory Kratos then stores its own hash. The import documentation now lists the limits for every hash algorithm.