结构: Simple
Abstraction: Variant
状态: Draft
被利用可能性: unkown
A J2EE application uses System.exit(), which also shuts down its container.
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.
Language: {'cwe_Name': 'Java', 'cwe_Prevalence': 'Undetermined'}
范围 | 影响 | 注释 |
---|---|---|
Availability | DoS: Crash, Exit, or Restart |
策略: Separation of Privilege
The shutdown function should be a privileged function available only to a properly authorized administrative user
策略:
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
Included in the doPost() method defined below is a call to System.exit() in the event of a specific exception.
bad Java
映射的分类名 | ImNode ID | Fit | Mapped Node Name |
---|---|---|---|
7 Pernicious Kingdoms | J2EE Bad Practices: System.exit() | ||
OWASP Top Ten 2004 | A9 | CWE More Specific | Denial of Service |
The CERT Oracle Secure Coding Standard for Java (2011) | ERR09-J | Do not allow untrusted code to terminate the JVM | |
Software Fault Patterns | SFP3 | Use of an improper API |