Skip to content

Commit c5395ee

Browse files
committed
Defense in depth: validate CSRF token when starting password reset flow (could be DoS bug at worse, allowing removal of an existing account's ability to log in; would not have revealed the reset code to the caller; cookie security would have prevented this POST)
1 parent f448a87 commit c5395ee

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

user-manager/service/src/main/java/com/peterphi/usermanager/ui/impl/UserUIServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ public Response changePassword(final int userId,
273273
@AuthConstraint(role = UserLogin.ROLE_ADMIN)
274274
public Response startPasswordResetFlow(final int userId, final String token)
275275
{
276+
tokenStore.validate(TOKEN_USE, token);
277+
276278
final String resetCode = passwordResetService.start(userId);
277279

278280
TemplateCall call = templater.template("reset_password_flow_started");

0 commit comments

Comments
 (0)