程序創建了 cookie,但未將 HttpOnly 標記設置為 true。
Microsoft Internet Explorer 支持 HttpOnly cookie 屬性,可阻止客戶端腳本訪問 cookie。cross-site scripting 攻擊通常會訪問 cookie,以試圖竊取會話標識符或 authentication 標記。如果未啟用 HttpOnly,攻擊者就能更容易地訪問用戶 cookie。
例 1:以下示例中的代碼創建 cookie,但沒有設置 HttpOnly 屬性。
HttpCookie cookie = new HttpCookie("emailCookie", email);
Response.AppendCookie(cookie);
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management
[2] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A6 Security Misconfiguration
[3] Standards Mapping - FIPS200 - (FISMA) CM
[4] HttpCookie.HttpOnly Property Microsoft
[5] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Insufficient Authentication
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.10
[7] Amit Klein Round-up:Ways to bypass HttpOnly (and HTTP Basic auth)