From 9549693552e95ad927ce03724dbd459e0678766d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:36:49 +0000 Subject: [PATCH] bug: upgrade spring-security to 5.7.14 to fix CVE-2024-38827 (Boot 1.5.4 -> 2.7.18, Java 1.8 kept) --- UserFront/pom.xml | 7 ++++--- .../src/main/java/com/userFront/config/SecurityConfig.java | 4 ++-- .../service/UserServiceImpl/AppointmentServiceImpl.java | 2 +- UserFront/src/main/resources/application.properties | 7 +++++++ .../test/java/com/userFront/UserFrontApplicationTests.java | 5 +---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/UserFront/pom.xml b/UserFront/pom.xml index 902ec2b3..615c69f6 100644 --- a/UserFront/pom.xml +++ b/UserFront/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.4.RELEASE + 2.7.18 @@ -22,6 +22,7 @@ UTF-8 UTF-8 1.8 + 5.7.14 @@ -46,8 +47,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/UserFront/src/main/java/com/userFront/config/SecurityConfig.java b/UserFront/src/main/java/com/userFront/config/SecurityConfig.java index 40b10417..3931511f 100644 --- a/UserFront/src/main/java/com/userFront/config/SecurityConfig.java +++ b/UserFront/src/main/java/com/userFront/config/SecurityConfig.java @@ -67,8 +67,8 @@ protected void configure(HttpSecurity http) throws Exception { - @Autowired - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { // auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); //This is in-memory authentication auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder()); } diff --git a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java index 838ad223..0d62b84c 100644 --- a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java +++ b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java @@ -24,7 +24,7 @@ public List findAll() { } public Appointment findAppointment(Long id) { - return appointmentDao.findOne(id); + return appointmentDao.findById(id).orElse(null); } public void confirmAppointment(Long id) { diff --git a/UserFront/src/main/resources/application.properties b/UserFront/src/main/resources/application.properties index d7e04942..14cd5a2a 100644 --- a/UserFront/src/main/resources/application.properties +++ b/UserFront/src/main/resources/application.properties @@ -1,3 +1,10 @@ +# =============================== +# = SPRING +# =============================== + +# UserServiceImpl <-> AccountServiceImpl depend on each other; Spring Boot 2.6+ rejects circular references by default. +spring.main.allow-circular-references = true + # =============================== # = DATA SOURCE # =============================== diff --git a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java index 81fed97b..3e51f21d 100644 --- a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java +++ b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java @@ -1,11 +1,8 @@ package com.userFront; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringRunner.class) @SpringBootTest public class UserFrontApplicationTests {