Using spring boot 3.x version check valid path and add below method into security part.
.securityMatcher( "/.css", "/.js","/.svg","/.png","/.jpg")