fix(security): explicitly restrict Spring Boot Actuator endpoints in production config #87
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Security Issue — LOW / PRE-PRODUCTION CHECKLIST
Found in:
backend/src/main/resources/application.yamlThe current state
The
application.yamldoes not explicitly restrict which actuator endpoints are exposed. The only actuator-related entry is disabling the mail health indicator.SecurityConfig.javapermits/actuator/healthunauthenticated (correct, needed for Docker health checks) and requires authentication for everything else — but only if the endpoints are actually enabled.Spring Boot's default in Boot 3+ is to expose only
healthover HTTP, which is good. However, this is an implicit default. It is not documented in the config, and a well-meaning developer addingmanagement.endpoints.web.exposure.include=*for debugging could accidentally expose/actuator/heapdumpin production without realizing it.What
/actuator/heapdumpleaks: a full JVM heap dump containing every in-memory object — including the PostgreSQL password, the MinIO secret key, and every active Spring Session token.The fix
Make the production-safe configuration explicit in
application.yaml:And in
application-dev.yaml(dev profile only), allow more for developer convenience:Add an integration test that asserts sensitive endpoints return non-200 without ADMIN credentials:
Why
Security through implicit defaults is fragile. One config change in a future PR can flip the exposure from safe to catastrophic. An explicit
include: "health"means a PR that opens up more endpoints is visible in code review.Priority
LOW for the current home-network deployment. HIGH before any public or internet-adjacent deployment. The fix is a two-line YAML change — do it early.
Audit note (2026-05-07) — heightened urgency after CVE disclosure
Live
trivy fsagainstbackend/pom.xmlconfirms two CRITICAL Spring CVEs that intersect with this issue:spring-boot-starter-actuator@4.0.0: Authentication bypass via misconfigured Health Group additional path.spring-boot-starter-actuator@4.0.0: Authentication bypass under Actuator CloudFoundry endpoints.spring-boot@4.0.0: Default security filter chain has no authorization rule with Actuator.Fixed in Spring Boot 4.0.6. A separate P0 issue will track the dependency bump itself.
The work in this issue (explicit
management.endpoints.web.exposureallowlist, secure non-healthendpoints) remains valid and complementary — even after the patch, the principle of "explicit, minimal exposure" is the defensive default.Suggested AC additions
application-prod.yaml:management.endpoints.web.exposure.includeis an explicit allowlist (e.g.,health,info,prometheus), never*./actuator/prometheusis allowed only for the scrape source (network ACL or token)./actuator/healthexposes a different shape externally (justUP/DOWN) than internally (with subsystem detail).Tracked in audit doc as part of F-22 (Critical, escalated). See
docs/audits/2026-05-07-pre-prod-architectural-review.mdAppendix A.1.1.