J2EE Bad Practices: Use of System.exit() |
Weakness ID: 382 (Weakness Variant) | Status: Draft |
Description Summary
Example 1
Included in the doPost() method defined below is a call to System.exit() in the event of a specific exception.
Access to a function that can shut down the application is an avenue for Denial of Service (DoS) attacks. The shutdown function should be a privileged function available only to a properly authorized administrative user. Any other possible cause of a shutdown is generally a security vulnerability. (In rare cases, the intended security policy calls for the application to halt as a damage control measure when it determines that an attack is in progress.) Web applications should not call methods that cause the virtual machine to exit, such as System.exit(). Web applications should also not throw any Throwables to the application server as this may adversely affect the container. 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. It is never a good idea for a web application to attempt to shut down the application container. A call to System.exit() is probably part of leftover debug code or code imported from a non-J2EE application. |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 227 | Failure to Fulfill API Contract ('API Abuse') | Development Concepts699 |
ChildOf | ![]() | 361 | Time and State | Seven Pernicious Kingdoms (primary)700 |
ChildOf | ![]() | 381 | J2EE Time and State Issues | Development Concepts (primary)699 |
ChildOf | ![]() | 705 | Incorrect Control Flow Scoping | Research Concepts (primary)1000 |
ChildOf | ![]() | 730 | OWASP Top Ten 2004 Category A9 - Denial of Service | Weaknesses in OWASP Top Ten (2004) (primary)711 |
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
7 Pernicious Kingdoms | J2EE Bad Practices: System.exit() | ||
OWASP Top Ten 2004 | A9 | CWE More Specific | Denial of Service |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
7 Pernicious Kingdoms | Externally Mined | |||
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Sean Eidemiller | Cigital | External | |
added/updated demonstrative examples | ||||
2008-07-01 | Eric Dalci | Cigital | External | |
updated Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Relationships, Other Notes, Taxonomy Mappings | ||||
Previous Entry Names | ||||
Change Date | Previous Entry Name | |||
2008-04-11 | J2EE Bad Practices: System.exit() | |||