Skip to main content

Weak credential policy - Password Change Limit

Description

The application does not limit the number of password change requests that can be made in a day.

Impact

Change the password multiple times in a short period of time, denying access to the original user.

Recommendation

Implement a mechanism that rejects multiple password change requests on the same day.

Threat

Internet user with access to the session.

Expected Remediation Time

⌚ 45 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: N
  • Attack complexity: L
  • Privileges required: L
  • User interaction: N
  • Scope: U
  • Confidentiality: N
  • Integrity: L
  • Availability: L

Temporal

  • Exploit code madurity: X
  • Remediation level: X
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L/E:X/RL:X/RC:X
  • Score:
    • Base: 5.4
    • Temporal: 5.4
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

The application sets a limit on the number of change password attempts

const changePassword = (req, res) => {
if (!isConfirmedUser(req.body.user)) {
const user = req.body.user;
const passTimeStamp = user.password.timestamp;
if(passTimeStamp <= MinLimit){
return res("Unable to change password");
}
//Change password after checking limit
const hashed_password = hashPassword(req.body.newPassword);
updateUser(req.body.user, {password: hashed_password});
res.redirect('/profile/');
}
}

Non compliant code

The application allows multiple password changes without establishing time out limits

const changePassword = (req, res) => {
if (!isConfirmedUser(req.body.user)) {
//Change password without checking limit requests
const hashed_password = hashPassword(req.body.newPassword);
updateUser(req.body.user, {password: hashed_password});
res.redirect('/profile/');
}
}

Requirements