...
| Code Block | ||
|---|---|---|
| ||
public class Hook {
public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
hookShutdown();
}
});
//other code
}
public static void hookShutdown() {
// Log shutdown and close all resources
}
}
|
Risk Assessment
TODOAllowing inadvertent calls to System.exit() may lead to denial-of-service attacks.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
CTL01-J | ?? low ?? | unlikely | ?? medium | P?? | L?? |
Automated Detection
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
| Wiki Markup |
|---|
\[[Kalinovsky 04|AA. Java References#Kalinovsky 04]\] Chapter 16 Intercepting a Call to System.exit
\[[API 06|AA. Java References#API 06]\] [method checkExit()| |
Java Documentation
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/SecurityManager.html#checkExit(int |
Custom security managers,
)] \[[Austin 00|AA. Java References#Austin 00]\] [Writing a Security Manager|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed2.html |
] |