CWE-652: Improper Neutralization of Data within XQuery Expressions ('XQuery Injection')
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The product uses external input to dynamically construct an XQuery expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.
扩展描述
The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).
常见后果
影响范围: Confidentiality
技术影响: Read Application Data
说明: An attacker might be able to read sensitive information from the XML database.
潜在缓解措施
阶段: Implementation
描述: Use parameterized queries. This will help ensure separation between data plane and control plane.
阶段: Implementation
描述: Properly validate user input. Reject data where appropriate, filter where appropriate and escape where appropriate. Make sure input that will be used in XQL queries is safe in that context.
引入模式
| 阶段 | 说明 |
|---|---|
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
适用平台
编程语言
分类映射
| 分类名称 | 条目ID | 条目名称 | 映射适配度 |
|---|---|---|---|
| WASC | 46 | XQuery Injection | - |
| Software Fault Patterns | SFP24 | Tainted input to command | - |