Summary
Dromara free-fs has an authentication-attempt restriction weakness in its password-reset flow. An unauthenticated attacker who knows a user's email address may repeatedly guess the six-digit reset code during its 300-second validity period and potentially set a new password to take over the account.
Affected context
The issue affects Dromara free-fs versions 2.0.1 through 2.3.1 in the password-reset endpoint, PUT /apis/user/forget-password. Risk arises when the endpoint permits unlimited code guesses while a six-digit reset code remains valid for 300 seconds.
Exploit preconditions
- Attack surface: The password-reset API must be reachable by the attacker.
- Required access: No authentication is required; the attacker needs a target user's email address.
- Trigger point: Repeated code submissions to
PUT /apis/user/forget-passwordduring the reset-code validity window. - Why exploitation is possible: The reset flow does not sufficiently restrict authentication attempts, allowing guesses against a six-digit code without an effective attempt limit.
Why this happens
The underlying issue is insufficient throttling or limiting of repeated authentication attempts, which maps to CWE-307: Improper Restriction of Excessive Authentication Attempts. When a password-reset verification code can be guessed repeatedly during its validity period, the recovery mechanism does not adequately constrain attempts to verify the user's identity.
Potential impact
- An attacker may guess a valid reset code and set a chosen password.
- A targeted user account could be taken over.
- Account takeover could expose private data or enable actions available to the compromised account.
General mitigation guidance
Defensive patterns focus on making reset-code guessing impractical and limiting abuse of account recovery:
- Enforce strict attempt limits and progressive delays for each reset challenge, account, and relevant source.
- Invalidate a challenge after a small number of failed attempts and require a fresh recovery flow.
- Use sufficiently unpredictable, time-limited, single-use verification tokens.
- Apply rate limits by default and avoid relying on source-address limits alone.
- Keep recovery permissions narrowly scoped and require appropriate verification before changing credentials.
How teams detect issues like this
- Review recovery endpoints for missing or ineffective per-challenge, per-account, and source-based attempt limits.
- Use static analysis and code review to identify verification loops or code paths that accept repeated guesses without lockout or throttling.
- Monitor for repeated invalid reset-code submissions, bursts of recovery requests, and attempts targeting multiple accounts.
- Enforce API security policies that require rate limiting, challenge expiration, and single-use recovery tokens.

