Ce projet Spring Boot est un cobaye volontairement dégradé destiné à tester un outil d'analyse de qualité et de sécurité. Il sert de projet cible pour le scanner DevSecOps.
| Dépendance | Version | CVE | Description |
|---|---|---|---|
spring-boot-starter-parent |
2.5.0 | Multiples | EOL depuis mai 2022 |
log4j-core |
2.14.0 | CVE-2021-44228 (Log4Shell, CVSS 10.0) | RCE via JNDI lookup |
h2 |
1.4.200 | CVE-2021-42392 (CVSS 9.8) | RCE via JNDI dans console H2 |
commons-collections |
3.2.1 | CVE-2015-4852 (CVSS 9.8) | Désérialisation RCE |
jackson-databind |
2.9.0 | CVE-2017-7525, CVE-2018-7489 | Désérialisation non sécurisée |
| Règle Sonar | Emplacement | Description |
|---|---|---|
| S2068 | CustomerService, Customer |
Credentials / mots de passe hardcodés |
| S2077 | CustomerService |
Injection SQL (JDBC sans PreparedStatement) |
| S5145 | CustomerService |
Log injection (entrée utilisateur dans les logs) |
| S5122 | CustomerController |
CORS ouvert * + endpoints non sécurisés |
| S1166 | CustomerService |
Exception avalée dans bloc catch vide |
| S1148 | CustomerService |
e.printStackTrace() interdit |
| S106 | CustomerService |
System.out.println() au lieu d'un logger |
| S1068 | Customer |
Champ inutilisé internalCode |
| S1481 | CustomerService |
Variable locale non utilisée unused |
| S1144 | CustomerService |
Méthode privée jamais appelée |
| S3655 | CustomerService |
Optional.get() sans isPresent() |
| S4144 | CustomerService, CustomerController |
Méthodes dupliquées |
| S2160 | Customer |
Pas de equals()/hashCode() sur l'entité |
| S2885 | CustomerService |
Logger non static final |
| S4684 | CustomerController |
Réponse HTTP manquante sur DELETE |
- Aucun
spring-boot-starter-security - Console H2 ouverte (
web-allow-others=true) - Tous les Actuator endpoints exposés sans auth (
management.endpoints.web.exposure.include=*) - Endpoint
/api/customers/admin/all-passwordsaccessible librement - CORS global
@CrossOrigin(origins = "*") - Aucune validation des entrées (
@Validabsent)
mvn spring-boot:runEndpoints disponibles :
GET http://localhost:8080/api/customersPOST http://localhost:8080/api/customersGET http://localhost:8080/api/customers/search?name=testGET http://localhost:8080/api/customers/admin/all-passwordsGET http://localhost:8080/h2-consoleGET http://localhost:8080/actuator