Web 應用程序必須定義默認的錯誤頁面,以避免攻擊者通過應用程序容器的內置錯誤響應來挖掘信息。
當攻擊者瀏覽網站尋找漏洞時,站點提供信息的數量是攻擊成敗的關鍵。如果應用程序向攻擊者展示了堆棧蹤跡,那么堆棧釋放的信息將使攻擊者的攻擊變得輕而易舉。例如,一個堆棧跟蹤可能會給攻擊者顯示 SQL 查詢字串、即使用的數據庫類型以及應用程序容器的版本。攻擊者可以從這些信息中找到這些組件中存在的漏洞。
因此,應用程序應通過配置來指定一個默認的錯誤頁面,以保證應用程序永遠不會向攻擊者泄漏錯誤消息。處理標準 HTTP 錯誤代碼是一種簡單、有效、安全的做法;完善的配置還會定義一個用于補救的錯誤處理程序,來捕獲應用程序可能拋出的所有異常。
[1] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A6 Information Leakage and Improper Error Handling
[2] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A6 Security Misconfiguration
[3] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A7 Improper Error Handling
[4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3120 CAT II
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3120 CAT II
[6] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 7
[7] G. Hoglund, G. McGraw Exploiting Software Addison-Wesley
[8] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.2, Requirement 6.5.6
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.5
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.7