Missing XML Validation
The software accepts XML from an untrusted source but does not validate the XML against the proper schema.
Most successful attacks begin with a violation of the programmer's assumptions. By accepting an XML document without validating it against a DTD or XML schema, the programmer leaves a door open for attackers to provide unexpected, unreasonable, or malicious input.
The following examples help to illustrate the nature of this weakness and describe methods or techniques which can be used to mitigate the risk.
Note that the examples here are by no means exhaustive and any given weakness may have many subtle varieties, each of which may require different detection methods or runtime controls.
The following code loads and parses an XML file.
The XML file is loaded without validating it against a known XML Schema or DTD.
The following code creates a DocumentBuilder object to be used in building an XML document.
The DocumentBuilder object does not validate an XML document against a schema, making it possible to create an invalid XML document.
Weaknesses in this category are related to a software system's components for input validation, output validation, or other kinds of validation. Validation is a freque...
This category identifies Software Fault Patterns (SFPs) within the Tainted Input to Command cluster (SFP24).
This view (slice) covers all the elements in CWE.
This view (slice) lists weaknesses that can be introduced during implementation.
This view (slice) displays only weakness base elements.