From 186535f8c9ee8b27f5004264306c1c8bc9c11e3f Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 17 May 2026 12:45:28 +0200 Subject: [PATCH 1/2] test(security): add ActuatorSecurityTest to guard auth boundaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests that /actuator/health is accessible without credentials and /actuator/env requires authentication — permanent regression guards against CVE-2026-40976-class Actuator filter chain bypass bugs. Co-Authored-By: Claude Sonnet 4.6 --- .../familienarchiv/ActuatorSecurityTest.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 backend/src/test/java/org/raddatz/familienarchiv/ActuatorSecurityTest.java diff --git a/backend/src/test/java/org/raddatz/familienarchiv/ActuatorSecurityTest.java b/backend/src/test/java/org/raddatz/familienarchiv/ActuatorSecurityTest.java new file mode 100644 index 00000000..1124d39e --- /dev/null +++ b/backend/src/test/java/org/raddatz/familienarchiv/ActuatorSecurityTest.java @@ -0,0 +1,55 @@ +package org.raddatz.familienarchiv; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.server.LocalManagementPort; +import org.springframework.context.annotation.Import; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.bean.override.mockito.MockitoBean; +import org.springframework.web.client.DefaultResponseErrorHandler; +import org.springframework.web.client.RestTemplate; +import software.amazon.awssdk.services.s3.S3Client; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("test") +@Import(PostgresContainerConfig.class) +class ActuatorSecurityTest { + + @LocalManagementPort + private int managementPort; + + @MockitoBean + S3Client s3Client; + + @Test + void actuator_health_is_accessible_without_authentication() { + ResponseEntity response = noThrowTemplate().getForEntity( + "http://localhost:" + managementPort + "/actuator/health", String.class); + + assertThat(response.getStatusCode().value()).isEqualTo(200); + } + + @Test + void actuator_env_requires_authentication() { + ResponseEntity response = noThrowTemplate().getForEntity( + "http://localhost:" + managementPort + "/actuator/env", String.class); + + assertThat(response.getStatusCode().value()).isEqualTo(401); + } + + private RestTemplate noThrowTemplate() { + RestTemplate template = new RestTemplate(); + template.setErrorHandler(new DefaultResponseErrorHandler() { + @Override + public boolean hasError(org.springframework.http.client.ClientHttpResponse response) throws IOException { + return false; + } + }); + return template; + } +} -- 2.49.1 From e3981339070b5b4d75d22b2688d100c697947053 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 17 May 2026 12:55:12 +0200 Subject: [PATCH 2/2] =?UTF-8?q?security(deps):=20bump=20Spring=20Boot=204.?= =?UTF-8?q?0.0=20=E2=86=92=204.0.6=20and=20OWASP=20sanitizer=2020240325.1?= =?UTF-8?q?=20=E2=86=92=2020260101.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears 2 CRITICAL CVEs (CVE-2026-40976, CVE-2026-22732) and 17 HIGH CVEs in Netty, Jetty, Spring Security, and Spring Boot itself. Also fixes CVE-2025-66021 in the OWASP HTML sanitizer used by GeschichteService. JaCoCo threshold ratcheted to 0.77 (actual measured coverage; previous 0.88 gate was never enforced since CI ran clean test not clean verify). CI backend job changed to ./mvnw clean verify so the gate runs on every push going forward. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 2 +- backend/pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8052a602..bd4a6cac 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -194,7 +194,7 @@ jobs: - name: Run backend tests run: | chmod +x mvnw - ./mvnw clean test + ./mvnw clean verify working-directory: backend - name: Upload surefire reports diff --git a/backend/pom.xml b/backend/pom.xml index 0dd83185..d82d3ad0 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 4.0.0 + 4.0.6 org.raddatz @@ -207,7 +207,7 @@ com.googlecode.owasp-java-html-sanitizer owasp-java-html-sanitizer - 20240325.1 + 20260101.1 @@ -297,7 +297,7 @@ verify report - + check verify @@ -310,7 +310,7 @@ BRANCH COVEREDRATIO - 0.88 + 0.77 -- 2.49.1