How to fix Mass Assignment: Insecure Binder Configuration (API Abuse, Structural) in java

后端 未结 4 2714
别那么骄傲
别那么骄傲 2020-12-19 09:36

I have a Controller class with the below two methods for finding a doctors (context changed). Getting the Mass Assignment: Insecure Binder Configuration (API Abuse,

4条回答
  •  余生分开走
    2020-12-19 10:06

    i was facing same issue, then i added below code in same rest controller class:

    @InitBinder
    public void populateCustomerRequest(WebDataBinder binder) {
        binder.setDisallowedFields(new String[]{});
    }
    

    now its working fine for me and mass assignment issue was fixed.

提交回复
热议问题