Exceptions that are thrown while logging is in progress can prevent successful logging unless special care is taken. Failure to account for exceptions during the logging process can cause security vulnerabilities, such as allowing an attacker to conceal critical security exceptions by preventing them from being logged. Consequently, programs must ensure that data logging continues to operate correctly even when exceptions are thrown during the logging process.
...
Writing such exceptions to the standard error stream is inadequate for logging purposes. First, the standard error stream may be exhausted, preventing recording of subsequent exceptions. Second, the trust level of the standard error stream may be insufficient for recording certain security-critical exceptions or errors without leaking sensitive information. If an I/O error occurs were to occur while writing the security exception, the catch
block will would throw an IOException
and the critical security exception will would be lost. Finally, an attacker may disguise the exception so that it occurs with several other innocuous exceptions.
...
Related Vulnerabilities
HARMONY-5981 describes a vulnerability in the HARMONY implementation of Java. In this implementation, the FileHandler
class can receive log messages, but if one thread closes the associated file, a second thread will throw an exception when it tries to log a message.
Bibliography
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="38cad995d5185e5d-a886791a-4fde4235-8472a37a-a8427e1724227d00f94c80da"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | [Class Logger | http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0e98c8587e1c4031-7c0c89bf-4d55457b-9d358ba8-9ea6a76e4b7c1a6b9edce031"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [Chapter 11, Exceptions | http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4922c83555d2b098-8f36f5bc-4c7a439e-bfc988aa-926fc274b06b7c315051c23e"><ac:plain-text-body><![CDATA[ | [[Ware 2008 | AA. Bibliography#Ware 08]] |
| ]]></ac:plain-text-body></ac:structured-macro> |
...