領先一步
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
之外,沒有保護任何 servletrequestMatchers(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
,而 DispatcherServlet
會有效地取代它。 在許多情況下,可以從容器的全局配置中刪除此類 servlet。
如果不需要額外的 servlet,請嘗試刪除它們,看看錯誤是否仍然存在。 如果仍然存在,請按照錯誤訊息中的指示進行操作。
有關如何解決錯誤訊息的幾個範例,請參閱以下緩解儲存庫。
此問題由 Kudelski Security 的資深軟體工程師 Mouad Kondah 發現並負責地報告。
要報告 Spring 產品組合中專案的安全性漏洞,請參閱安全性原則