Missing Authorization (ARCH8120)
Ce contenu n’est pas encore disponible dans votre langue.
Key kotlin.security.missing-authorization · Severity warning · Category security · CWE CWE-862
Flags a @RestController with state-changing mappings and no @PreAuthorize / @Secured / @RolesAllowed anywhere in the class.
Incorrect
Section titled “Incorrect”@RestControllerclass AdminController { @DeleteMapping("/users/{id}") fun delete(...) }Correct
Section titled “Correct”@RestController@PreAuthorize("hasRole('ADMIN')")class AdminController { ... }Guard the class or each mutating action with an authorization annotation.