All exceptions reveal information that can assist an attacker's efforts to carry out a denial of service (DoS) against the system. Consequently, programs must filter both exception messages and exception types that can propagate across trust boundaries. The following table lists several problematic exceptions.
Description of Information Leak or Threat
Underlying file system structure, user name enumeration
Database structure, user name enumeration
Enumeration of open ports when untrusted client can choose server port
May provide information about thread-unsafe code
Insufficient server resources (may aid DoS)
Underlying file system structure
Printing the stack trace can also result in unintentionally leaking information about the structure and state of the process to an attacker. When a Java program that is run within a console terminates because of an uncaught exception, the exception's message and stack trace are displayed on the console; the stack trace may itself contain sensitive information about the program's internal structure. Consequently, any program that may be run on a console accessible to an untrusted user must never abort due to an uncaught exception.
Exceptions may inadvertently reveal sensitive information unless care is taken to limit the information disclosure.
|SECURITY.WSC.ACPST, SERVLET.CETS, SECURITY.ESD.ACW||Implemented|
|Exceptions should not be thrown from servlet methods|
CVE-2009-2897 describes several cross-site scripting (XSS) vulnerabilities in several versions of SpringSource Hyperic HQ. These vulnerabilities allow remote attackers to inject arbitrary web script or HTML via invalid values for numerical parameters. They are demonstrated by an uncaught
java.lang.NumberFormatException exception resulting from entering several invalid numeric parameters to the web interface.
CVE-2015-2080 describes a vulnerability in the Jetty web server, versions 9.2.3 to 9.2.8, where an illegal character passed in an HTML request causes the server to respond with an error message containing the text with the illegal character. But this error message can also contain sensitive information, such as cookies from previous web requests.
9.1, Security Exceptions
|\[Gotham 2015\]||JetLeak Vulnerability: Remote Leakage Of Shared Buffers In Jetty Web Server|