December 4, 2026
BOPLA: The Spring Boot Bug That Lets Users Fill Out Fields You Never Gave Them
BOLA is the wrong record. BFLA is the wrong function. BOPLA is the wrong field, and it’s the one that survives a blanket @RequestBody…

By Najee Shaheen
3 min read
BOLA is the wrong record. BFLA is the wrong function. BOPLA is the wrong field, and it's the one that survives a blanket @RequestBody entity binding without anyone noticing.
This closes out a trilogy. I've written about BOLA (right function, wrong object) and BFLA (right object, wrong function). The third member of the family is BOPLA: Broken Object Property Level Authorization. It asks a question neither of the other two do: given the right user, hitting the right function, on the right object, should they be allowed to set this specific field?
OWASP actually folds two distinct failure modes under this one category: excessive data exposure (the API returns fields the client shouldn't see) and mass assignment (the API accepts fields the client shouldn't be able to set). The second is the more dangerous of the two, and the one Spring Boot developers run into constantly without recognizing it, so that's the one this article is about.
The Setup
Here's a profile update endpoint that looks completely reasonable:
@PostMapping("/users/{id}")
public ResponseEntity<User> updateProfile(@PathVariable Long id,
@RequestBody User update) {
User user = userRepository.findById(id).orElseThrow();
user.setName(update.getName());
user.setEmail(update.getEmail());
userRepository.save(user);
return ResponseEntity.ok(user);
}@PostMapping("/users/{id}")
public ResponseEntity<User> updateProfile(@PathVariable Long id,
@RequestBody User update) {
User user = userRepository.findById(id).orElseThrow();
user.setName(update.getName());
user.setEmail(update.getEmail());
userRepository.save(user);
return ResponseEntity.ok(user);
}The handler only reads name and email off the incoming object. That looks safe. The bug isn't in what the code reads. It's in what @RequestBody User update agreed to accept in the first place.
Jackson deserializes the entire JSON body into a full User object, including every field that object exposes a public setter for. If User has a role field, an isVerified flag, or an accountBalance, the client can send it whether or not your handler ever intended to let them.
A request like this deserializes without complaint:
{
"name": "Najee",
"email": "n@example.com",
"role": "ADMIN"
}{
"name": "Najee",
"email": "n@example.com",
"role": "ADMIN"
}The handler above happens to ignore role today, but the object it deserialized into is holding a live, populated ADMIN value the moment Jackson finishes parsing. The bug is one refactor away from becoming exploitable: swap the manual field-by-field copy for BeanUtils.copyProperties(update, user), or let a JPA merge operate on the detached entity directly, and the extra field rides along for free, and no new code path is required, just one less line of manual filtering.
Why This Isn't Just "Another Auth Bug"
The three articles in this series all describe the same underlying failure. An API trusted something about the caller it had no business trusting, applied to a different axis each time:
BOLA: which record is the caller allowed to touch?
BFLA: which function is the caller allowed to invoke?
BOPLA: which fields on that record is the caller allowed to set?
That third question is easy to miss because it doesn't look like an authorization decision at all. It looks like ordinary data binding. Nobody writes if (callerCanSetRole()) and forgets it. The bug isn't a missing check; it's that the type itself never should have accepted the field to begin with. There's no if statement to audit for, because the vulnerability is structural, not logical.
The Fix: Bind to a DTO, Not the Entity
The fix isn't to add more filtering logic; it's to remove the ability for the extra field to exist on the deserialization target at all.
Define a request-specific type that only contains what the client is actually allowed to set:
public record UserUpdateRequest(String name, String email) {}
@PostMapping("/users/{id}")
public ResponseEntity<User> updateProfile(@PathVariable Long id,
@RequestBody UserUpdateRequest update) {
User user = userRepository.findById(id).orElseThrow();
user.setName(update.name());
user.setEmail(update.email());
userRepository.save(user);
return ResponseEntity.ok(user);
}public record UserUpdateRequest(String name, String email) {}
@PostMapping("/users/{id}")
public ResponseEntity<User> updateProfile(@PathVariable Long id,
@RequestBody UserUpdateRequest update) {
User user = userRepository.findById(id).orElseThrow();
user.setName(update.name());
user.setEmail(update.email());
userRepository.save(user);
return ResponseEntity.ok(user);
}Send the same payload with a role field now, and Jackson has nowhere to put it. UserUpdateRequest has no role property, no setter, no binding path.
The field is silently dropped during deserialization, not filtered after the fact. This is the same "structural over remembered" pattern from the BOLA and BFLA articles, applied to field-level trust instead of record-level or function-level trust: the DTO is an allowlist by construction, not by developer discipline.
Why this beats trying to blocklist fields instead
The tempting shortcut is to keep binding to the entity and just remember not to call setRole(), or to strip specific fields out after binding. Both approaches put the safety guarantee on the deny list: they work until someone adds a new sensitive field to the entity and forgets to add the corresponding guard.
A DTO puts the guarantee on the allow list: a new sensitive field added to User is safe by default, because UserUpdateRequest simply doesn't mention it. The endpoint doesn't need to be updated to stay secure. It already is.
Going Further: Validation Belongs on the DTO Too
Once you're binding to a dedicated request type, it becomes the natural place to enforce input validation as well, not just authorization scope.
Bean Validation annotations on the DTO keep both concerns (what fields exist, and what values they're allowed to hold) in one place, next to each other:
public record UserUpdateRequest(
@NotBlank @Size(max = 100) String name,
@Email String email
) {}public record UserUpdateRequest(
@NotBlank @Size(max = 100) String name,
@Email String email
) {}This isn't strictly a BOPLA concern, but it falls out naturally once the DTO exists. You've already created the one place where "what the client is allowed to send" is defined, so defining "and what shape it has to be in" costs almost nothing extra.
Final Note
For read paths, the same principle applies in reverse: don't return your entity directly from a @GetMapping either. A User entity returned as-is will happily serialize a password hash or an internal audit field straight into the JSON response, for the same root reason. The type wasn't designed to be the response contract, it just got used as one.
A response DTO closes that half of BOPLA the same way a request DTO closes the mass-assignment half: by construction, not by remembering to filter.
The Takeaway
Three articles, one recurring lesson: the safest authorization check is the one that isn't a check at all. It's a type that makes the wrong thing impossible to express.
BOLA is fixed by querying for the object scoped to the caller.
BFLA is fixed by declaring who's allowed to call the function.
BOPLA is fixed by declaring what a request is allowed to contain.
Same move, three different layers of the request.