搶先一步
VMware 提供培訓和認證,以加速您的進步。
瞭解更多除非另有說明,否則嚴重程度很高。
Spring Security 版本 5.8(低於 5.8.5)、6.0(低於 6.0.5)和 6.1(低於 6.1.2)可能容易受到授權規則錯誤配置的影響,如果應用程式使用 requestMatchers(String)
或 requestMatchers(HttpMethod, String)
和多個 servlet,其中一個是 Spring MVC 的 DispatcherServlet。
(DispatcherServlet
是一個 Spring MVC 元件,它將 HTTP 端點對映到 @Controller
註解類上的方法。)
具體來說,當以下所有條件都為真時,應用程式容易受到攻擊
DispatcherServlet
)requestMatchers(String)
或 requestMatchers(HttpMethod, String)
如果以下任何一項為真,則應用程式不易受到攻擊
DispatcherServlet
requestMatchers(String)
或 requestMatchers(HttpMethod, String)
受影響版本的使用者應採取以下緩解措施。
首先
其次,如果您使用多個 servlet 並且其中一個是 Spring MVC 的 DispatcherServlet
,您可能會在啟動時看到以下錯誤訊息
This method cannot decide whether these patterns are Spring MVC patterns or not.
If this endpoint is a Spring MVC endpoint, please use `requestMatchers(MvcRequestMatcher)`;
otherwise, please use `requestMatchers(AntPathRequestMatcher)`.
有時不需要這些額外的 servlet。 例如,某些 servlet 容器將新增一個 DefaultServlet
,該 servlet 有效地被 DispatcherServlet
替換。 在許多情況下,可以從容器的全域性配置中刪除此類 servlet。
如果不需要額外的 servlet,請嘗試刪除它們,看看錯誤是否仍然存在。 如果是這樣,請按照錯誤訊息中的說明進行操作。
有關如何解決該錯誤訊息的幾個示例,請參閱 以下緩解儲存庫。
此問題由 Kudelski Security 的高階軟體工程師 Mouad Kondah 發現並負責任地報告。
要報告 Spring 產品組合中某個專案的安全漏洞,請參閱安全策略