CWE-799: Improper Control of Interaction Frequency

Description

The product does not properly limit the number or frequency of interactions that it has with an actor, such as the number of incoming requests.

Submission Date :

Jan. 15, 2010, midnight

Modification Date :

2023-06-29 00:00:00+00:00

Organization :

MITRE
Extended Description

This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.

Example Vulnerable Codes

Example - 1

In the following code a username and password is read from a socket and an attempt is made to authenticate the username and password. The code will continuously checked the socket for a username and password until it has been authenticated.


isValidUser = AuthenticateUser(username, password);if (getNextMessage(socket, password, PASSWORD_SIZE) > 0) {}if (getNextMessage(socket, username, USERNAME_SIZE) > 0) {}
char username[USERNAME_SIZE];char password[PASSWORD_SIZE];while (isValidUser == 0) {}return(SUCCESS);

This code does not place any restriction on the number of authentication attempts made. There should be a limit on the number of authentication attempts made to prevent brute force attacks as in the following example code.


isValidUser = AuthenticateUser(username, password);if (getNextMessage(socket, password, PASSWORD_SIZE) > 0) {}
if (getNextMessage(socket, username, USERNAME_SIZE) > 0) {}count++;
return(SUCCESS);
return(FAIL);int count = 0;while ((isValidUser == 0) && (count < MAX_ATTEMPTS)) {}if (isValidUser) {}else {}

Related Weaknesses

This table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined to give an overview of the different insight to similar items that may exist at higher and lower levels of abstraction.

Visit http://cwe.mitre.org/ for more details.