CWE
Home > CWE List > CWE-112 Individual Dictionary Definition (Draft 9)   View the CWE List

CWE-112 Individual Dictionary Definition (Draft 9)

Missing XML Validation
Weakness ID
Status: Draft

112 (Weakness Base)

Description

Summary

Failure to enable validation when parsing XML gives an attacker the opportunity to supply malicious input.

Weakness Ordinality

Primary (Weakness exists independent of other weaknesses)

Causal Nature

Explicit (This is an explicit weakness resulting from behavior of the developer)

Potential Mitigations

Always validate XML input against a known XML Schema or DTD.

Assume all input is malicious. Use an appropriate combination of black lists and white lists to ensure only valid and expected input is processed by the system.

Context Notes

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. It is not possible for an XML parser to validate all aspects of a document's content; a parser cannot understand the complete semantics of the data. However, a parser can do a complete and thorough job of checking the document's structure and therefore guarantee to the code that processes the document that the content is well-formed.

Relationships
NatureTypeIDName
ChildOfWeakness ClassWeakness ClassWeakness Class20Insufficient Input Validation
Source Taxonomies

7 Pernicious Kingdoms - Missing XML Validation

Applicable Platforms

All

Related Attack Patterns
CAPEC-IDAttack Pattern Name
99XML Parser Attack
Page Last Updated: April 21, 2008