
CVE-2025-22235 is a Spring Boot security vulnerability involving the EndpointRequest.to() method, which may generate an incorrect matcher when configuring security rules, leading to the security protection failing for non-exposed actuator endpoint paths (such as /null/**).
When using EndpointRequest.to("health") to configure security rules, if the health endpoint is not configured in management.endpoints.web.exposure.include, Spring Boot generates an incorrect path matcher /null/**, causing all requests under that path to bypass authentication checks.
management.endpoints.web.exposure.include=info (only the info endpoint is exposed, the health endpoint is not exposed)EndpointRequest.to("health") to reference a non-exposed endpointmvn spring-boot:run
Visit http://localhost:8080/null directly – it can be accessed without login, confirming an authentication bypass vulnerability exists.
Accessing other protected endpoints such as http://localhost:8080/info will require login.
.requestMatchers(EndpointRequest.to("health")).permitAll() // Vulnerability trigger point
.requestMatchers("/null").authenticated() // Should be protected but bypassed
@GetMapping("/null")
public String sensitiveEndpoint() {
return "Seeing this page without login indicates the CVE-2025-22235 authentication bypass vulnerability!";
}
Upgrade to the following fixed versions:
EndpointRequest.to() is enabled and exposed via the web/null pathThe root cause of the vulnerability is that the EndpointRequest.to() method generates an incorrect path matcher when processing a non-exposed endpoint. When the endpoint name is not configured in management.endpoints.web.exposure.include, Spring Boot creates a path pattern containing null, causing the security rule to become invalid.
This demonstration project is for security research and educational purposes only. Do not use it in production environments. All risks arising from using this project are borne by the user.