CVE-2025-22235:
Spring Boot EndpointRequest.to() creates wrong matcher if actuator endpoint is not exposed
7.3
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.springframework.boot:spring-boot | maven | <= 2.7.24.2 | |
org.springframework.boot:spring-boot | maven | >= 3.1.0, <= 3.1.15.2 | |
org.springframework.boot:spring-boot | maven | >= 3.2.0, <= 3.2.13.2 | |
org.springframework.boot:spring-boot | maven | >= 3.3.0, <= 3.3.10 | 3.3.11 |
org.springframework.boot:spring-boot | maven | >= 3.4.0, <= 3.4.4 | 3.4.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability, as described, occurs when EndpointRequest.to()
is used for an actuator endpoint that is disabled or not exposed, leading to a matcher for null/**
. The provided commit 55f67c9a522647039fd3294dee5cb83f4888160a
patches the EndpointRequest.java
files for both servlet and reactive stacks.
The core issue was that PathMappedEndpoints.getPath(endpointId)
could return null
for unexposed endpoints. This null
value was then processed by the streamPaths
method within the inner EndpointRequestMatcher
class. Before the patch, streamPaths
did not filter out these null
paths.
These null
paths were then used by the createDelegate
methods (one in the servlet version, one in the reactive version of EndpointRequestMatcher
) to construct matchers.
- In the servlet version, the
null
path was passed toRequestMatcherFactory.antPath
, which would then treat thenull
as the string "null" when creating the pattern, resulting innull/**
. - In the reactive version, the
null
path was passed togetDelegateMatcher
, which would then create aPathPatternParserServerWebExchangeMatcher
usingpath + "/**"
, effectively becoming"null/**"
.
The patches address this by:
- Modifying
streamPaths
to explicitly filter outnull
values returned bypathMappedEndpoints.getPath()
. - Adding
Assert.notNull
checks inRequestMatcherFactory.antPath
(servlet) andgetDelegateMatcher
(reactive) to preventnull
paths from being processed into matchers. - Modifying the
createDelegate
methods to return anEMPTY_MATCHER
if no valid delegate matchers can be formed (e.g., if all specified endpoints are unexposed and their paths become null and are filtered out).
The createDelegate
methods in EndpointRequest$EndpointRequestMatcher
for both servlet and reactive stacks are identified as the vulnerable functions because they orchestrate the faulty logic of using these potentially null paths to create the incorrect matchers. They are the highest-level methods within the matcher object (returned by EndpointRequest.to()
) where the decision to form matchers based on these paths occurs.