SonarQube shows a security error in Spring Framework controllers and in Spring Framework Application main class

断了今生、忘了曾经 提交于 2019-12-24 11:39:14

问题


Should I take this security warning seriously, this warning shows up in every controller

https://rules.sonarsource.com/java/RSPEC-4529

when I declare a controller like this

@RequestMapping(path = "/profile", method = RequestMethod.GET) 
public UserProfile getUserProfile(String name) {
...
}

and this warning shows up in the application class

https://rules.sonarsource.com/java/RSPEC-4823

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

回答1:


Yes, you should take security warnings seriously. At least for enterprise application.

If you have developed this application for learning something then it's totally your choice. Otherwise securing HTTP endpoint is best practice.

SonarQube hotspot rule is helping you to identify all such endpoints which show security vulnerability.



来源:https://stackoverflow.com/questions/54856544/sonarqube-shows-a-security-error-in-spring-framework-controllers-and-in-spring-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!