强化批量分配:使用ExceptionHandler进行不安全的活页夹配置

时间:2018-07-04 11:47:07

标签: java fortify

我遇到了以下代码的强化警报,错误为Mass Assignment: Insecure Binder Configuration

我的控制器类在下面用于异常处理

class MyController {
...
    @ExceptionHandler
        @ResponseStatus(HttpStatus.NOT_FOUND)
        public ErrorResponse handleRequestNotFoundException(RequestNotFoundException exception) {
            log.error("The request was not found", exception);
            return ErrorResponse.builder().message("Request not found").build();
        }
...
}

例外类是

@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "No such request found")
public class RequestNotFoundException extends RuntimeException {
}

有人可以帮助我们如何摆脱此警报吗?预先感谢

0 个答案:

没有答案