界: Environment

本節包括原始程式碼之外的所有內容,但對於建立中產品的安全性仍至關重要。由於此領域所涵蓋的問題與原始程式碼沒有直接關係,因此我們將其與其他領域分開。

Struts Misconfiguration: Invalid Path

Abstract
無效路徑項目可能讓 Struts 找不到服務要求所需的正確資源位置。
Explanation
Struts 使用 path 屬性來尋找處理要求所需的資源。因為路徑為相對模式的位置,如果路徑不是以「/」字元開頭則視為錯誤。

範例 1:以下組態包含空白路徑。

<global-exceptions>
<exception key="global.error.invalidLogin" path="" scope="request" type="InvalidLoginException" />
</global-exceptions>
範例 2:以下組態使用不是以「/」字元開頭的路徑。

<global-forwards>
<forward name="login" path="Login.jsp" />
</global-forwards>
References
[1] Apache Struts Specification
[2] Chuck Caveness, Brian Keeton
[3] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[4] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[5] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[6] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[7] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
desc.config.java.struts_misconfiguration_invalid_path