The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks. 900 Category ChildOf 866 800 Category ChildOf 808 1000 699 Weakness ChildOf 287 1000 Weakness ChildOf 799 711 Category ChildOf 724 809 Category ChildOf 812 888 Category ChildOf 898 Architecture and Design Access_Control Bypass protection mechanism An attacker could perform an arbitrary number of authentication attempts using different passwords, and eventually gain access to the targeted account. Architecture and Design Common protection mechanisms include: Disconnecting the user after a small number of failed attempts Implementing a timeout Locking out a targeted account Requiring a computational task on the user's part. Architecture and Design Libraries or Frameworks Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Consider using libraries with authentication capabilities such as OpenSSL or the ESAPI Authenticator. [R.307.1] In January 2009, an attacker was able to gain administrator access to a Twitter server because the server did not restrict the number of login attempts. The attacker targeted a member of Twitter's support team and was able to successfully guess the member's password using a brute force attack by guessing a large number of common words. Once the attacker gained access as the member of the support staff, he used the administrator panel to gain access to 33 accounts that belonged to celebrities and politicians. Ultimately, fake Twitter messages were sent that appeared to come from the compromised accounts. Kim Zetter Weak Password Brings ���Happiness��� to Twitter Hacker 2009-01-09 http://www.wired.com/threatlevel/2009/01/professed-twitt/ The following code, extracted from a servlet's doPost() method, performs an authentication lookup every time the servlet is invoked. Java String username = request.getParameter("username"); String password = request.getParameter("password"); int authResult = authenticateUser(username, password); However, the software makes no attempt to restrict excessive authentication attempts. This code attempts to limit the number of login attempts by causing the process to sleep before completing the authentication. PHP $username = $_POST['username']; $password = $_POST['password']; sleep(2000); $isAuthenticated = authenticateUser($username, $password); However, there is no limit on parallel connections, so this does not increase the amount of time an attacker needs to complete an attack. In the following C/C++ example the validateUser method opens a socket connection, reads a username and password from the socket and attempts to authenticate the username and password. C C++ int validateUser(char *host, int port) { int socket = openSocketConnection(host, port); if (socket < 0) { printf("Unable to open socket connection"); return(FAIL); } int isValidUser = 0; char username[USERNAME_SIZE]; char password[PASSWORD_SIZE]; while (isValidUser == 0) { if (getNextMessage(socket, username, USERNAME_SIZE) > 0) { if (getNextMessage(socket, password, PASSWORD_SIZE) > 0) { isValidUser = AuthenticateUser(username, password); } } } return(SUCCESS); } The validateUser method will continuously check for a valid username and password without any restriction on the number of authentication attempts made. The method should limit the number of authentication attempts made to prevent brute force attacks as in the following example code. C C++ int validateUser(char *host, int port) { ... int count = 0; while ((isValidUser == 0) && (count < MAX_ATTEMPTS)) { if (getNextMessage(socket, username, USERNAME_SIZE) > 0) { if (getNextMessage(socket, password, PASSWORD_SIZE) > 0) { isValidUser = AuthenticateUser(username, password); } } count++; } if (isValidUser) { return(SUCCESS); } else { return(FAIL); } } CVE-1999-1152 Product does not disconnect or timeout after multiple failed logins. CVE-2001-1291 Product does not disconnect or timeout after multiple failed logins. CVE-2001-0395 Product does not disconnect or timeout after multiple failed logins. CVE-2001-1339 Product does not disconnect or timeout after multiple failed logins. CVE-2002-0628 Product does not disconnect or timeout after multiple failed logins. CVE-1999-1324 User accounts not disabled when they exceed a threshold; possibly a resultant problem. OWASP OWASP Enterprise Security API (ESAPI) Project http://www.owasp.org/index.php/ESAPI Multiple Failed Authentication Attempts not Prevented AUTHENT.MULTFAIL PLOVER Sean Eidemiller Cigital 2008-07-01 added/updated demonstrative examples CWE Content Team MITRE 2008-09-08 updated Relationships, Taxonomy_Mappings CWE Content Team MITRE 2009-03-10 updated Relationships CWE Content Team MITRE 2009-07-27 updated Observed_Examples CWE Content Team MITRE 2009-12-28 updated Applicable_Platforms, Demonstrative_Examples, Potential_Mitigations CWE Content Team MITRE 2010-02-16 updated Demonstrative_Examples, Name, Potential_Mitigations, Relationships, Taxonomy_Mappings CWE Content Team MITRE 2010-04-05 updated Demonstrative_Examples CWE Content Team MITRE 2011-03-29 updated Demonstrative_Examples CWE Content Team MITRE 2011-06-01 updated Common_Consequences CWE Content Team MITRE 2011-06-27 updated Common_Consequences, Related_Attack_Patterns, Relationships CWE Content Team MITRE 2011-09-13 updated Potential_Mitigations, References, Relationships CWE Content Team MITRE 2012-05-11 updated Relationships Multiple Failed Authentication Attempts not Prevented Failure to Restrict Excessive Authentication Attempts