在未釋放當前會話標識符的情況下驗證用戶會給攻擊者竊取驗證會話的機會。
Session Fixation 漏洞會在以下情況中出現:
1. 當 Web 應用程序驗證某一用戶時,沒有首先釋放當前會話,而是繼續使用已經與該用戶關聯的會話。
2. 攻擊者能夠奪取已知的用戶會話標識符,因此,一旦該用戶進行驗證,攻擊者便可以訪問經過驗證的會話。
在通常情況下,攻擊者會利用 Session Fixation 漏洞在 Web 應用程序中創建一個新會話,并且記錄與之關聯的會話標識符。然后,攻擊者會設法使受害者在服務器中的驗證失敗,從而通過當前會話來訪問用戶帳號。
例如:下面的例子是 J2EE web 應用程序中的一個代碼片斷,該應用程序利用直接粘貼至 j_security_check 來驗證用戶,而不會在處理登錄請求之前釋放當前會話。
<form method="POST" action="j_security_check">
<input type="text" name="j_username">
<input type="text" name="j_password">
</form>
[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) APP3090 CAT II
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3405 CAT I
[6] Cross-Site Scripting and Header Manipulation Descriptions Fortify, An HP Company
[7] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 384
[8] Standards Mapping - FIPS200 - (FISMA) IA
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.3
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.7
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.8
[12] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Session Fixation
[13] D. Whalen The Unofficial Cookie FAQ