How to fix Veracode CWE 117 (Improper Output Neutralization for Logs)

后端 未结 5 1581
遥遥无期
遥遥无期 2021-02-02 01:21

There is an Spring global @ExceptionHandler(Exception.class) method which logs exception like that:

@ExceptionHandler(Exception.class)
void handleEx         


        
5条回答
  •  佛祖请我去吃肉
    2021-02-02 01:33

    Though I am a bit late but I think it would help those who do not want to use ESAPI library and facing issue only for exception handler class

    Use apache commons library

    import org.apache.commons.lang3.exception.ExceptionUtils;
    LOG.error(ExceptionUtils.getStackTrace(ex));
    

提交回复
热议问题