在 <any> 元素中指定命名空間 ##any,意味著該架構允許存在除其中明確定義的元素之外的其他元素,從而使創建惡意文檔更容易。
不限制元素命名空間的架構,會允許有效文檔中包含任意元素。這使攻擊者更易于實施像 XML Injection 之類的攻擊,他們會添加不符合文檔其余內容標準的標簽。
下列架構允許存在無限制的命名空間。
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name='foo'>
<xs:complexType>
<xs:sequence>
<xs:any namespace='##any' />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
[1] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A1 Injection
[2] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A1 Unvalidated Input
[3] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A2 Injection Flaws
[4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3510 CAT I
[5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3510 CAT I
[6] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 20
[7] Standards Mapping - SANS Top 25 2009 - (SANS 2009) Insecure Interaction - CWE ID 020
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.3.1.1, Requirement 6.5.2
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.1
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.1
[11] XML Schema Part 1:Structures Second Edition W3C