Skip to content

Commit

Permalink
chore: fix major vuln reported by @Baw-Appie
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Mar 14, 2021
1 parent bfc911d commit 323a7c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/v1/meiling/lost-password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export async function meilingV1LostPasswordHandler(req: FastifyRequest, rep: Fas

await User.addPassword(uuid, body.password);

await setPasswordResetSession(req, undefined);

rep.send({ success: true });
return;
}
Expand Down Expand Up @@ -231,7 +233,7 @@ export async function meilingV1LostPasswordHandler(req: FastifyRequest, rep: Fas
return;
}

const isValid = verifyChallenge(passwordReset.method, passwordReset.challenge, body.data.challengeResponse);
const isValid = await verifyChallenge(passwordReset.method, passwordReset.challenge, body.data.challengeResponse);
if (!isValid) {
sendMeilingError(rep, MeilingV1ErrorType.AUTHORIZATION_REQUEST_INVALID, 'invalid challenge');
return;
Expand Down

0 comments on commit 323a7c4

Please sign in to comment.