--- url: "https://owasp.org/www-community/attacks/Denial_of_Service" titulek: "Denial of Service | OWASP Foundation" h1: "Denial of Service" popis: "Denial of Service on the main website for The OWASP Foundation. OWASP is a nonprofit foundation that works to improve the security of software." jazyk: "en" kanonicka: "https://community.owasp.org/attacks/Denial_of_Service" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 00:41:51" znaku: 8065 slov: 1259 kodovani: "utf-8" sha256: "62707692da418a1587add8fb5c65761657b5b34a4d42b407cc4cdf11f8d3d8a6" --- # Denial of Service **Author:** Nsrav **Contributor(s):** KristenS, Adar Weidman, psiinon, Adrew Smith, Jkurucar, kingthorin ## Description The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed. There are many ways to make a service unavailable for legitimate users by manipulating network packets, programming, logical, or resources handling vulnerabilities, among others. If a service receives a very large number of requests, it may cease to be available to legitimate users. In the same way, a service may stop if a programming vulnerability is exploited, or the way the service handles resources it uses. Sometimes the attacker can inject and execute arbitrary code while performing a DoS attack in order to access critical information or execute commands on the server. Denial-of-service attacks significantly degrade the service quality experienced by legitimate users. These attacks introduce large response delays, excessive losses, and service interruptions, resulting in direct impact on availability. ## Risk Factors Risk factors can break down into multiple categories. Two principle sources of risk include inadequate resources and non-technical threat motivators. The first example of a risk factor, inadequate resources, requires attention if system architecture was not designed to meet traffic demand overflows. This risk reduces the difficulty of successfully executing a DoS attack and can, left unchecked, result in DoS symptoms absent an actual attack. The second example and perhaps the largest risk factor is not technical and is in the domain of public relations or strategic communications. An organization should avoid taking action that can make them a target of a DoS attack unless the benefits of doing so outweigh the potential costs or mitigating controls are in place. Other risk factors may also exist depending on the specific environment. ## Examples The following DoS techniques and examples were extracted from OWASP Testing Guide v2. ### DoS User Specified Object Allocation If users can supply, directly or indirectly, a value that will specify how many of an object to create on the application server, and if the server does not enforce a hard upper limit on that value, it is possible to cause the environment to run out of available memory. The server may begin to allocate the required number of objects specified, but if this is an extremely large number, it can cause serious issues on the server, possibly filling its whole available memory and corrupting its performance. The following is a simple example of vulnerable code in Java: ``` String TotalObjects = request.getParameter(“numberofobjects”); int NumOfObjects = Integer.parseInt(TotalObjects); ComplexObject[] anArray = new ComplexObject[NumOfObjects]; // wrong! ``` ### DoS User Input as a Loop Counter Similar to the previous problem of User Specified Object Allocation, if the user can directly or indirectly assign a value that will be used as a counter in a loop function, this can cause performance problems on the server. The following is an example of vulnerable code in Java: ``` public class MyServlet extends ActionServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { . . . String [] values = request.getParameterValues("CheckboxField"); // Process the data without length check for reasonable range – wrong! for ( int i=0; i