Ladies and Gentleman,
Recently I came across an issue with Log Forgery 
(http://cwe.mitre.org/data/definitions/117.html) - a problem where line feed 
characters passed over to logging results in extra log entries created when 
simple file-based logging is used.
Checked briefly with log4j appenders, also the mailing list, but found no 
methods of protection against it. So now if a "\r\n" is added, it can result in 
two log entries, e.g. with FileAppender. Not being black belt in log4j, 
however, it might happen that I overlooked something. So any hints? 
Cheers,Gabor P.s.: Googling "log4j log forgery" brings 
http://www.jtmelton.com/2010/09/21/preventing-log-forging-in-java/ as a result, 
which suggests a wrapper, utilizing ESAPI functions to sanitize... - this also 
raises the question, if it is really the supported way of fixing this issue by 
always wrapping log4j into another API before using? 
 

Reply via email to