934
with "sinks" (destinations where the data interacts with external components, a lower layer such
as the OS, etc.)
Effectiveness = High
Potential Mitigations
Phase: Architecture and Design
Strategy = Separation of Privilege
The shutdown function should be a privileged function available only to a properly authorized
administrative user
Phase: Implementation
Web applications should not call methods that cause the virtual machine to exit, such as
System.exit()
Phase: Implementation
Web applications should also not throw any Throwables to the application server as this may
adversely affect the container.
Phase: Implementation
Non-web applications may have a main() method that contains a System.exit(), but generally
should not call System.exit() from other locations in the code
Demonstrative Examples
Example 1:
Included in the doPost() method defined below is a call to System.exit() in the event of a specific
exception.
Example Language: Java (Bad)
Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
...
} catch (ApplicationSpecificException ase) {
logger.error("Caught: " + ase.toString());
System.exit(1);
}
}
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 361 7PK - Time and State 700 2320
MemberOf 730 OWASP Top Ten 2004 Category A9 - Denial of Service 711 2339
MemberOf 851 The CERT Oracle Secure Coding Standard for Java
(2011) Chapter 8 - Exceptional Behavior (ERR)
844 2365
MemberOf 1001 SFP Secondary Cluster: Use of an Improper API 888 2420
MemberOf 1141 SEI CERT Oracle Secure Coding Standard for Java -
Guidelines 07. Exceptional Behavior (ERR)
1133 2448
MemberOf 1410 Comprehensive Categorization: Insufficient Control
Flow Management
1400 2536
Taxonomy Mappings
CWE Version 4.14
CWE-383: J2EE Bad Practices: Direct Use of Threads
CWE-383: J2EE Bad Practices: Direct Use of Threads