Spring MVC 7.0
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
4prompts
- Java 25113 lines · 2.8K tokens
- Spring Framework 7.070 lines · 2.4K tokens
- Spring Boot 4.162 lines · 2.7K tokens
- Spring MVC 7.060 lines · 1.8K tokens
Total305 lines · 9.6K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 190
- 201
- 208
- 209
- 214
- 250
- 295
- 297
- 306
- 319
- 323
- 327
- 338
- 346
- 347
- 352
- 362
- 367
- 378
- 409
- 427
- 470
- 471
- 494
- 502
- 524
- 532
- 552
- 601
- 611
- 639
- 653
- 681
- 732
- 749
- 770
- 772
- 776
- 789
- 807
- 829
- 862
- 863
- 913
- 915
- 916
- 918
- 922
- 942
- 1333
Prompt Preview
Apply the Spring Boot 4.1 baseline first. These rules cover Spring Framework MVC 7.0.9.
Routing and binding
- Bind request data to dedicated command objects, not persistence entities, keeping tenant and approval-state fields, as well as the baseline's server-owned fields, out of the writable model.
- Use
WebDataBinder.setAllowedFieldsandsetDeclarativeBinding(true)for explicit property binding, and@ModelAttribute(binding=false)when an existing object must not be rebound. - Cap request parameter counts and collection sizes before binding, alongside the Spring Framework auto-growth limits.
- Validate path, query, header, cookie, form, multipart, and JSON values after conversion, including cross-field and authorization invariants.
- Reject
BindingResultorErrorsfailures before business logic; an adjacent error argument lets the controller run with that argument's validation errors. - Constrain
@RequestBodydeserialization through itsHttpMessageConverterand DTO;WebDataBinderallowed fields do not filter JSON or XML properties. - Map routes and HTTP methods explicitly and reject unsupported content types before selecting a converter or allocating large request objects.
Authorization and dispatch behavior
- Authorize the resolved object and transition inside the service transaction; a mapped controller, path variable, or successful converter does not prove ownership.
- Cover
REQUEST,ASYNC,ERROR, andFORWARDdispatches in security-filter registration and security rules so an error page, forward, or resumed async request cannot bypass