Skip to content

Commit

Permalink
fix: disallow registration attempts with password length > 4096
Browse files Browse the repository at this point in the history
This is a stopgap measure for v1.15.0
  • Loading branch information
julianlam committed Nov 3, 2020
1 parent 35e725d commit c0f699e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controllers/authentication.js
Expand Up @@ -94,6 +94,10 @@ authenticationController.register = async function (req, res) {
throw new Error('[[user:change_password_error_match]]');
}

if (userData.password.length > 4096) {
throw new Error('[[error:password-too-long]]');
}

user.isPasswordValid(userData.password);

res.locals.processLogin = true; // set it to false in plugin if you wish to just register only
Expand Down

0 comments on commit c0f699e

Please sign in to comment.