Skip to content

Commit 09b5222

Browse files
committed
Disable suffix pattern matching for Endpoints
Update EndpointHandlerMapping so that setUseSuffixPatternMatch is set to false. This prevents URLs of the form /beans.json from returning results and provides another line of defense against RDF attacks. Fixes gh-4402
1 parent 10d407a commit 09b5222

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints,
8080
CorsConfiguration corsConfiguration) {
8181
this.endpoints = new HashSet<MvcEndpoint>(endpoints);
8282
this.corsConfiguration = corsConfiguration;
83+
setUseSuffixPatternMatch(false);
8384
// By default the static resource handler mapping is LOWEST_PRECEDENCE - 1
8485
// and the RequestMappingHandlerMapping is 0 (we ideally want to be before both)
8586
setOrder(-100);

0 commit comments

Comments
 (0)