0

在 Filter 类 doFilter() 方法中抛出 Servlet 异常时,会打印异常 ID,这会导致“未处理异常”Veracode 漏洞。下面是我的代码。

public void doFilter(ServletRequest request,ServletResponse response, FilterChain chain) throws IO Exception, ServletException{
//some code
    if(//some condition){
          chain.doFilter(request, response);
    }else{
       throw new ServletException("Attack detected!");
    }

Servlet Exception 正在打印,但它是沿 Exception Id 打印的,这会导致 veracode 漏洞。

你能帮我解决这个问题吗?提前致谢

4

0 回答 0