我们在 Qualys 报告中发现了基于路径的漏洞问题。我已经完成了类似这样的 stackoverflow 问题,并将 useDefaultSuffixPattern 配置为 false,如下所示。
我仍然可以使用 /about.anything 加载页面,即使在控制器中我已经给出了 @RequestMapping(value = "/about")
我们是否需要更新任何其他配置以阻止这种情况发生?
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="order" value="0" />
<!-- Set whether to register paths using the default suffix pattern as
well: i.e. whether "/users" should be registered as "/users.*" and "/users/"
too. Default is "true". Turn this convention off if you intend to interpret
your @RequestMapping paths strictly. Note that paths which include a ".xxx"
suffix or end with "/" already will not be transformed using the default
suffix pattern in any case. -->
<property name="useDefaultSuffixPattern" value="false" />
<property name="pathMatcher" ref="pathMatcher" />
</bean>
我们使用的是 hybris 1811 版本