Actuator and management exposure
- Since Spring Boot 2, only health is exposed over HTTP by default. Configurations with management.endpoints.web.exposure.include=* undo that.
- /actuator/heapdump returns a memory dump that often contains passwords, tokens and session data.
- /actuator/env and /actuator/configprops show properties, with masking that depends on version and configuration.
- Management endpoints on the main port behind the same gateway as the API are easy to reach by accident.
Spring Security configuration
Authorisation is often defined as a list of request matchers. Order matters, a permitAll() pattern can be broader than intended, and mismatches between how Spring Security and Spring MVC normalise paths have produced real bypasses (trailing slashes, encoded characters, matrix parameters). Method-level @PreAuthorize annotations only work if method security is enabled. Tests should try path variants for every protected route.
Injection and known critical CVEs
- SpEL injection when user input reaches an ExpressionParser, and template injection in Thymeleaf fragment expressions.
- Spring4Shell (CVE-2022-22965): data binding to class.module.classLoader on JDK 9+ with WAR deployment on Tomcat.
- Log4Shell (CVE-2021-44228) remains present in unpatched services that log request headers with log4j 2.
- Java deserialisation of untrusted data in legacy endpoints; ysoserial generates test payloads.
Gateways, CORS and multi-service setups
Spring Boot services often sit behind Spring Cloud Gateway or another proxy that adds authentication. If the downstream service trusts headers such as X-User-Id from the gateway, any route that reaches the service directly, or any header the gateway forgets to strip, becomes an impersonation path. CORS configured with allowedOriginPatterns('*') and allowCredentials(true) is another frequent finding worth testing directly.
Pointing Pentest-Swarm at Spring Boot
Pentest-Swarm tests the running service over HTTP. Its shipped CVE-tied chains include safe, non-weaponised verification chains for Log4Shell and Spring4Shell.
- Recon probes springdoc's /v3/api-docs and older /v2/api-docs paths and maps the published API automatically.
- Content discovery and nuclei templates look for exposed Actuator endpoints.
- Log4Shell-style findings are confirmed with an out-of-band callback via interactsh when you run with
--verify. - Run api-security with a test user's token via
--authfor object- and function-level authorisation checks.
Where it falls short
A black-box test confirms what the deployed service exposes, not which dependency versions are on the classpath. Pair it with software composition analysis for Spring and logging libraries, and review SecurityFilterChain configuration in code; the free edition also limits its strongest exploitation features.
Questions
Is Spring Boot Actuator dangerous?
Not by default, since only health is exposed over HTTP. It becomes dangerous when endpoints like heapdump or env are exposed publicly without authentication.
Are Log4Shell and Spring4Shell still worth testing for?
Yes on older or vendor-supplied Java services. Patching was widespread but not universal, and testing is cheap.
Can Pentest-Swarm use my springdoc OpenAPI spec?
Yes. Recon checks /v3/api-docs and similar paths and turns documented endpoints into test targets.