When a remote user-controlled data value can be used as part of the limit of times an operation can be executed, such behavior could lead to a denial of service.
+ +Ensure the limitation and the validation of any incoming value to a reasonable value.
+ ++In this example a user-controlled data value such as `1_000` reaches a repeatable operation as `1_000` times. A simple exploit would be for an attacker to send a huge value as `999_999_999` or provoke an endless loop with a negative value. +
+ +To fix this vulnerability, it is required to constrain the size of the user input and validate the incoming value.
+ +For illustration purposes, we can limit the possible values for the user input to between `1` and `1_000`.
+ +