通過共享相同的基本域的應用程序可訪問域范圍過大的會話 cookie。
開發者通常將會話 cookie 設置為類似“.example.com”的基本域。然而,這會使會話 cookie 暴露在基本域名和任何子域中的所有 Web 應用程序下。泄露會話 cookie 可導致危及帳戶安全。
例:
假設您有一個安全應用程序并將其部署在 http://secure.example.com/ 上,當用戶登錄時,該應用程序將使用域“.example.com”設置會話 ID cookie。
應用程序的配置文件中的條目如下:
session.cookie_domain=.example.com
http://insecure.example.com/ 上有另一個不太安全的應用程序,它包含 cross-site scripting 漏洞。任何瀏覽到 http://insecure.example.com 的 http://secure.example.com 認證用戶面臨著暴露來自 http://secure.example.com 的會話 cookie 的風險。
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management
[2] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A6 Information Leakage and Improper Error Handling
[3] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A6 Security Misconfiguration
[4] Standards Mapping - FIPS200 - (FISMA) CM
[5] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.10
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.7
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.8
[9] Runtime Configuration The PHP Group