表單中的每個字段都應該對照相應的 validation form 進行驗證。
即使遺漏其中一個輸入字段的驗證,也會成為攻擊者可利用的破綻。
未經檢驗的輸入是導致當今一些最糟糕、最常見的軟件安全問題的根源。Cross-site scripting、SQL injection 和 process control 漏洞是由于缺少輸入驗證或者輸入驗證不完整造成的。雖然 J2EE 應用程序通常情況下不容易受到內存損壞的影響,但是如果 J2EE 應用程序連接到未執行數組邊界檢查的本地代碼,攻擊者就可能會利用 J2EE 應用程序中一個輸入校驗錯誤發起 buffer overflow 攻擊。
一些應用程序使用同一個 ActionForm 來實現多個目的。在類似的情況下,一些字段在部分 action 映射中可能會失效。對失效的字段也進行驗證是至關重要的。最好是對 unused field 進行嚴格的控制,使其只能處于空白或未定義狀態。如果 unused field 沒有經過驗證,則 action 中的共享業務邏輯可能會允許攻擊者繞過針對表單其他用途所執行的驗證檢查。
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A1 Unvalidated Input
[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] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 105
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.1
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.1
[8] Standards Mapping - FIPS200 - (FISMA) SI
[9] T. Husted et al. Struts in Action:Building Web Applications with the Leading Java Framework Manning Publications
[10] The Struts project The Apache Foundation