This section includes everything that is outside of the source code but is still critical to the security of the product that is being created. Because the issues covered by this kingdom are not directly related to source code, we separated it from the rest of the kingdoms.
<sp:SymmetricBinding>
<wsp:Policy>
<sp:SignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:SignatureToken>
...
</wsp:Policy>
</sp:SymmetricBinding>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorSignatureToken>
<sp:RecipientEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientEncryptionToken>
<sp:RecipientSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientSignatureToken>
...
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorEncryptionToken>
<sp:RecipientEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientEncryptionToken>
<sp:RecipientSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientSignatureToken>
...
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorEncryptionToken>
<sp:InitiatorSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorSignatureToken>
<sp:RecipientSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientSignatureToken>
...
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorEncryptionToken>
<sp:InitiatorSignatureToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:InitiatorSignatureToken>
<sp:RecipientEncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:RecipientEncryptionToken>
...
</wsp:Policy>
</sp:AsymmetricBinding>
<SignedParts>
tag does not contain a <sp:Attachments>
tag:
<sp:SignedParts>
<sp:Body/>
</sp:SignedParts>
<SignedParts>
tag does not contain a <sp:Body>
tag:
<sp:SignedParts>
<sp:Header .../>
</sp:SignedParts>
<SignedParts>
tag does not contain a <sp:Headery>
tag:
<sp:SignedParts>
<sp:Body/>
</sp:SignedParts>
<sp:SymmetricBinding>
<wsp:Policy>
<sp:EncryptionToken>
<wsp:Policy>
...
</wsp:Policy>
</sp:EncryptionToken>
...
</wsp:Policy>
</sp:SymmetricBinding>
<IncludeTimestamp>
tag commented out:
<sp:AsymmetricBinding>
<wsp:Policy>
...
<!--<sp:IncludeTimestamp/>-->
<sp:ProtectTokens/>
<sp:OnlySignEntireHeadersAndBody/>
</wsp:Policy>
</sp:AsymmetricBinding>
<ProtectTokens>
tag:
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorToken>
...
</sp:InitiatorToken>
<sp:RecipientToken>
...
</sp:RecipientToken>
<sp:AlgorithmSuite>
...
</sp:AlgorithmSuite>
<sp:Layout>
...
</sp:Layout>
<sp:IncludeTimestamp/>
<sp:OnlySignEntireHeadersAndBody/>
</wsp:Policy>
</sp:AsymmetricBinding>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken11/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
processContents
attribute is set to lax
or skip
, no input validation is performed for wildcard elements and attributes.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name="cart" >
<xs:complexType>
<xs:sequence>
<xs:element name="itemID" maxOccurs="1" />
<xs:any namespace="http://itemInfo" processContents="lax" minOccurs="1" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://itemInfo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
</xsd:schema>
http://itemInfo
namespace to be validated against it, thus allowing the following XML to pass validation.
<?xml version=\"1.0\" ?>
<cart xmlns:itemInfo="http://itemInfo">
<itemID>123</itemID>
<itemInfo:name>Shoes</itemInfo:name>
<itemInfo:description>Black Shoes</itemInfo:description>
<itemInfo:price>1.00</itemInfo:price>
</cart>
itemInfo:price
tag which is not defined in Schema 2. As a result, it might be possible to trick the consumer of this XML document into setting a price of $1 for Shoes
.<any>
element makes it easier to perform attacks like XML injection.<any>
element means arbitrary tags can be included in a valid document. Permitting arbitrary content makes it easier for attackers to perform attacks like XML injection.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name="cart" >
<xs:complexType>
<xs:sequence>
<xs:element name="itemID" maxOccurs="1" />
<xs:element name="price" maxOccurs="1" />
<xs:element name="description" maxOccurs="1"/>
<xs:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="description" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="code" type="xs:string"/>
</xs:schema>
<any>
element, the following XML documentation will be considered valid.
<?xml version=\"1.0\" ?>
<cart>
<itemID>123</itemID>
<price>50.00</price>
<price>1.0</price>
</cart>
maxOccurs
value to unbounded can lead to resources exhaustion and ultimately a denial of service.bar
elements.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name="foo" >
<xs:complexType>
<xs:sequence>
<xs:element name="bar" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
##any
in the <any>
element means the schema allows elements beyond what is explicitly defined in the schema, thereby making it easier to craft malicious documents.
<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>