$ sudo docker run -ti -p 127.0.0.1:5000:5000 blabla1337/owasp-skf-lab:java-parameter-binding
Now that the app is running let's go hacking!
Reconnaissance
Mass assignment is a computer vulnerability where an active record pattern in a web application is abused to modify data items that the user should not normally be allowed to access such as password, granted permissions, or administrator status.
Please take note of the following code in the User.java . This line of code will prove critical for exploiting the parameter binding attack.
@PostMapping("/create")publicStringcreateUser(User user,Model model) { // here is the issueauthModel.createUser(user);model.addAttribute("content","Your user has been created");return"index"; }
To fully understand the attack we need to examine the properties "User" model, which looks like this: