Skip to main content

Account lockout

Description

It is possible to cause account lockouts, effectively blocking users from accessing the system.

Impact

Avoid the access of valid users to the application.

Recommendation

Avoid blocking users accounts as a mechanism of protection, make it more restrictive or control it to prevent an exploitation by attackers.

Threat

Anonymous attacker from the Internet.

Expected Remediation Time

⌚ 30 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: N
  • User interaction: N
  • Scope: U
  • Confidentiality: N
  • Integrity: N
  • Availability: L

Temporal

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

Result

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

Code Examples

Compliant code

The application performs automatic password change instead of blocking user accounts

app.use((req, res, next) => {
const userId = req.params.userId;
const password = req.params.password;
if(isValidUser(userId, password)){
//Code to handle login
} else if(getUserLoginAttempts(userId)>5){
sendPasswordChange(userId);
res.redirect("/login");
}
})

Non compliant code

The application has a functionality to block user accounts based on number of login tries

app.use((req, res, next) => {
const userId = req.params.userId;
const password = req.params.password;
if(isValidUser(userId, password)){
//Code to handle login
} else if(getUserLoginAttempts(userId)>5){
blockUser(userId);
}
})

Requirements

free trial

Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.