未受保護的 cookie 內容可能會被攻擊者偷窺或篡改。
Cookie 經常用來存儲用戶的重要信息,比如個人信息、authentication 標記以及活動歷史記錄。如果此信息是以明文形式存儲的,那么任何一個用戶只要能夠訪問與應用程序交互的指定計算機,就都能訪問存儲在 cookie 中的信息。更糟糕的是,如果攻擊者能夠隨意地修改 cookie 中存儲的數據,他們就能夠篡改提供給應用程序的信息,有可能改變系統的運行方式以對他們有利。
在許多情況下,應用程序可以根據其應用環境自動驗證來自 cookie 的輸入,但是 ASP.NET 的驗證框架提供了一種極好的方式,既能保護 cookie 的內容,又能驗證 cookie 未被意外修改。如果不使用這種方法,想要建立一個所有輸入都經過驗證的高級別信任度是一件非常困難、甚至不可能的事情。
[1] .NET Framework General Reference:forms Element Microsoft Corporation
[2] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management
[3] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A9 Insecure Communications
[4] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A9 Insufficient Transport Layer Protection
[5] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3210.1 CAT II
[6] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3210.1 CAT II
[7] Standards Mapping - FIPS200 - (FISMA) CM, SC
[8] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 565
[9] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Insufficient Authentication
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 4.1, Requirement 6.3.1.4, Requirement 6.5.9
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 4.1, Requirement 6.5.10
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 4.1, Requirement 6.5.4