CWE

Common Weakness Enumeration

A Community-Developed Dictionary of Software Weakness Types

CWE/SANS Top 25 Most Dangerous Software Errors Common Weakness Scoring System
Common Weakness Risk Analysis Framework
Home > CWE List > CWE- Individual Dictionary Definition (2.7)  

Presentation Filter:

CWE-91: XML Injection (aka Blind XPath Injection)

 
XML Injection (aka Blind XPath Injection)
Weakness ID: 91 (Weakness Base)Status: Draft
+ Description

Description Summary

The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.

Extended Description

Within XML, special elements could include reserved words or characters such as "<", ">", """, and "&", which could then be used to add new data or modify XML syntax.

+ Time of Introduction
  • Architecture and Design
  • Implementation
+ Applicable Platforms

Languages

All

+ Common Consequences
ScopeEffect

Technical Impact: Execute unauthorized code or commands; Read application data; Modify application data

+ Potential Mitigations

Phase: Implementation

Strategy: Input Validation

Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a whitelist of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs (i.e., do not rely on a blacklist). A blacklist is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, blacklists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness ClassWeakness Class74Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Development Concepts (primary)699
Research Concepts (primary)1000
ChildOfCategoryCategory713OWASP Top Ten 2007 Category A2 - Injection Flaws
Weaknesses in OWASP Top Ten (2007) (primary)629
ChildOfCategoryCategory727OWASP Top Ten 2004 Category A6 - Injection Flaws
Weaknesses in OWASP Top Ten (2004) (primary)711
ChildOfCategoryCategory810OWASP Top Ten 2010 Category A1 - Injection
Weaknesses in OWASP Top Ten (2010) (primary)809
ChildOfCategoryCategory896SFP Cluster: Tainted Input
Software Fault Pattern (SFP) Clusters (primary)888
ChildOfCategoryCategory929OWASP Top Ten 2013 Category A1 - Injection
Weaknesses in OWASP Top Ten (2013) (primary)928
ParentOfWeakness BaseWeakness Base643Improper Neutralization of Data within XPath Expressions ('XPath Injection')
Development Concepts699
Research Concepts1000
ParentOfWeakness BaseWeakness Base652Improper Neutralization of Data within XQuery Expressions ('XQuery Injection')
Development Concepts699
Research Concepts1000
+ Research Gaps

Under-reported. This is likely found regularly by third party code auditors, but there are very few publicly reported examples.

+ Theoretical Notes

In vulnerability theory terms, this is a representation-specific case of a Data/Directive Boundary Error.

+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
PLOVERXML injection (aka Blind Xpath injection)
OWASP Top Ten 2007A2Injection Flaws
OWASP Top Ten 2004A6Injection Flaws
WASC23XML Injection
+ References
Amit Klein. "Blind XPath Injection". 2004-05-19. <http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf>.
[REF-7] Mark Dowd, John McDonald and Justin Schuh. "The Art of Software Security Assessment". Chapter 17, "XML Injection", Page 1069.. 1st Edition. Addison Wesley. 2006.
+ Maintenance Notes

The description for this entry is generally applicable to XML, but the name includes "blind XPath injection" which is more closely associated with CWE-643. Therefore this entry might need to be deprecated or converted to a general category - although injection into raw XML is not covered by CWE-643 or CWE-652.

+ Content History
Submissions
Submission DateSubmitterOrganizationSource
Externally Mined
Modifications
Modification DateModifierOrganizationSource
2008-07-01CigitalExternal
updated Time_of_Introduction
2008-08-15VeracodeExternal
Suggested OWASP Top Ten 2004 mapping
2008-09-08MITREInternal
updated Relationships, Other_Notes, Taxonomy_Mappings
2008-10-14MITREInternal
updated Maintenance_Notes, Other_Notes, Theoretical_Notes
2010-02-16MITREInternal
updated Taxonomy_Mappings
2010-06-21MITREInternal
updated Description, Relationships
2011-06-01MITREInternal
updated Common_Consequences
2012-05-11MITREInternal
updated References, Relationships
2012-10-30MITREInternal
updated Potential_Mitigations
2014-02-18MITREInternal
updated Related_Attack_Patterns
2014-06-23MITREInternal
updated Relationships
Page Last Updated: June 23, 2014