Replies: 1 comment
-
|
Hello @jkoppolu |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Concern: Ory Kratos Recovery Flow Might Be Vulnerable to Brute-Force Guessing
We are using Ory Kratos (self-hosted) for authentication in our product, and I am looking for advice on how to harden the account recovery flow.
Recently, an external actor claimed that our current recovery setup could be abused to brute-force recovery codes. We are still investigating, but I wanted to check with the community to understand what the best practices are, especially since we are following Kratos' recommendation to use recovery codes over links for security and UX reasons.
Our Setup
We are using the code-based recovery flow (not recovery links), as recommended in the Kratos documentation.
Here is how it currently works:
Current configuration
What Was Claimed
The reporter claimed that because each recovery flow generates its own random code and previous flows remain valid, it is possible to:
This effectively multiplies the total number of valid guesses by the number of concurrent flows, making a large-scale brute-force attack theoretically possible.
The Math
Each code has a 1-in-1,000,000 chance of being guessed correctly.
If an attacker makes (T) total guesses across all flows:
P(success) = 1 - (1 - 10^-6)^TWith distributed IPs, the attacker could reach millions of guesses quickly.
For example, with 1,000 IPs, they could reach 3M total guesses in roughly 10 hours under our current rate limits.
What I Would Like Community Input On
Invalidating old flows
Rate limiting improvements
Code vs. link recovery
Additional safeguards
Production hardening
TL;DR
I would really appreciate any insights or experiences others can share.
Beta Was this translation helpful? Give feedback.
All reactions