CWE-382: J2EE Bad Practices: Use of System.exit()

Description

A J2EE application uses System.exit(), which also shuts down its container.

Submission Date :

July 19, 2006, midnight

Modification Date :

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

Organization :

MITRE
Extended Description

It is never a good idea for a web application to attempt to shut down the application container. Access to a function that can shut down the application is an avenue for Denial of Service (DoS) attacks.

Example Vulnerable Codes

Example - 1

Included in the doPost() method defined below is a call to System.exit() in the event of a specific exception.

...
logger.error("Caught: " + ase.toString());System.exit(1);try {} catch (ApplicationSpecificException ase) {}Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {}

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.