未指定用戶數據限制的安全限制不能保證受限制的資源在傳輸層受到保護。
web.xml 安全限制通常用于基于角色的 Access Control,而可選的 user-data-constraint 元素則用于指定可防止采用不安全方式傳輸內容的傳輸保證。
在 <user-data-constraint> 標簽中,<transport-guarantee> 標簽定義通信的處理方式。有三種級別的傳輸保證:
1) NONE 表示應用程序不要求任何傳輸保證。
2) INTEGRAL 表示應用程序要求采用傳輸過程中無法改變的方式在客戶端和服務器之間傳送數據。
3) CONFIDENTIAL 表示應用程序要求采用可防止其他實體查看傳輸內容的方式來傳輸數據。
在大多數情況下,使用 INTEGRAL 或 CONFIDENTIAL 表示需要 SSL/TLS。如果 <user-data-constraint> 和 <transport-guarantee> 標簽被忽略,傳輸保證在默認情況下為 NONE。
例 1:以下安全限制未指定傳輸保證。
<security-constraint>
<web-resource-collection>
<web-resource-name>Storefront</web-resource-name>
<description>Allow Customers and Employees access to online store front</description>
<url-pattern>/store/shop/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>Anyone</description>
<role-name>anyone</role-name>
</auth-constraint>
</security-constraint>
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management
[2] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A9 Insecure Communications
[3] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A9 Insufficient Transport Layer Protection
[4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3250.1 CAT I, APP3250.2 CAT I, APP3250.3 CAT II, APP3250.4 CAT II
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3250.1 CAT I, APP3250.2 CAT I, APP3250.3 CAT II, APP3250.4 CAT II
[6] Standards Mapping - FIPS200 - (FISMA) CM, SC
[7] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 5
[8] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage
[9] Sun Microsystems, Inc. Java EE 5 Tutorial:Establishing a Secure Connection Using SSL
[10] Sun Microsystems, Inc. Java Servlet Specification Version 2.3
[11] 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
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 4.1, Requirement 6.5.10
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 4.1, Requirement 6.5.4