如果將 PHP 配置為通過 URL 傳遞會話 ID,將容易受到 session fixation 和 session hijacking 攻擊。
如果啟用 session.use_trans_sid,會導致 PHP 通過 URL 傳遞會話 ID,這樣一來,攻擊者就更容易劫持當前會話,或者哄騙用戶使用已被攻擊者控制的現有會話。
通過 URL 傳遞的參數比 POST 參數和 cookie 值的可見性更好,這是因為它們通常出現在瀏覽器歷史記錄、書簽、日志文件及其他高度明顯的位置。如果攻擊者了解到系統上某一當前會話的機密會話標識符,他們就有可能將會話標識符返回給程序,以便劫持用戶會話。
除了 session hijacking 外,通過 URL 暴露會話 ID 還會引發 session fixation 攻擊。在通常情況下,攻擊者會利用 Session Fixation 漏洞在 Web 應用程序中創建一個新會話,并且記錄與之關聯的會話標識符。然后,攻擊者會設法使受害者在服務器中的驗證失敗,從而通過當前會話來訪問用戶帳號。通過 URL 傳遞會話標識符使得攻擊者有可能攻擊一大批受害者,這種攻擊的方式是將包含受到危害的會話標識符的 URL 通過電子郵件發送給受害者,或另外一種大規模通信機制來實現。
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A3 Broken Authentication and Session Management
[2] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A3 Broken Authentication and Session Management
[3] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A7 Broken Authentication and Session Management
[4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3405 CAT I
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3405 CAT I
[6] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 384
[7] Standards Mapping - FIPS200 - (FISMA) IA
[8] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[9] M. Achour et al. PHP Manual
[10] PHP Security Consortium PhpSecInfo Test Information
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.3
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.7
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.8