使用 ASP.NET 驗證框架來防止由未經檢驗的輸入數據導致的漏洞。
在 ASP.NET 應用程序中,未經檢驗的輸入數據是漏洞產生的根源。未經檢驗的輸入數據會導致許多漏洞,如 cross-site scripting、process control 和 SQL injection。
為了避免此類攻擊,我們應在輸入數據被應用程序處理之前使用 ASP.NET 驗證框架來檢驗所有程序的輸入數據。
驗證框架的示例用法包括進行檢查以確保:
- 在電話號碼字段中只包含有效字符
- 布爾值僅為 "T" 或者 "F"
- 未限定格式的字符串必須具有合理的長度,并且由有效的字符組成
[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 - Security Technical Implementation Guide Version 3 - (STIG 3) APP3510 CAT I
[4] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3510 CAT I
[5] Building Secure ASP.NET Pages and Controls Microsoft
[6] Standards Mapping - FIPS200 - (FISMA) CM
[7] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 554
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.1
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.1 , Requirement 6.5.7
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.10