Как исправить запрос, не очищенный стандартными методами очистки в SonarQube java - PullRequest
0 голосов
/ 26 февраля 2020

У меня есть запрошенный перехватчик, который будет извлекать параметры из запрошенного тела и назначать их переменным. Затем запрос будет перенаправлен на контроллер.

@Component
public class RequestInterceptor extends OncePerRequestFilter {

  @Autowired
  private Context context;

  @Override
  protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
      throws ServletException, IOException {
      if(some-condtion){
        context.functionA(request.getParameter("validateFor"));
        Context.setRunning(true);

      } else {
        response.sendError(403, "Already a process is running. Please wait!!");
        return;
      }

    filterChain.doFilter(request, response);

}

Когда я запускаю сонарный анализ, получаю ошибку request not sanitized with standard sanitization methods: normalize, encode [Note: As applicable, validate class member variables of type String, StringBuffer, CharSequence] с тегами api-design, cwe-79 для строки filterChain.doFilter(request, response);

Как с этим справиться? , Пытался санировать каждого участника запроса. Все еще не могу решить проблему.

...