【问题标题】:Path based vulnerability in Spring hybrisSpring hybris 中基于路径的漏洞
【发布时间】:2020-05-21 03:35:48
【问题描述】:

我们在 Qualys 报告中发现了基于路径的漏洞问题。我已经完成了诸如this one 之类的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 版本

【问题讨论】:

    标签: spring-security hybris qualys


    【解决方案1】:

    这可能是因为inherent bug in Spring 忽略了 URL 中点 (.) 之后的所有内容。
    要解决此问题,您必须创建 path variable pattern for GET call in your controller more rigid

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-11
      • 2019-05-05
      • 2022-12-19
      相关资源
      最近更新 更多