CWEweakness

CWE-643 Improper Neutralization of Data within XPath Expressions

High Official page ↗
Alternate terms
XPath Injection
Abstraction
Base
Structure
Simple
Status
Incomplete
Likelihood of exploit
High
Languages
Not Language-Specific
CWE version
5.0

Description

The product uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input.

Common consequences

• Access Control: Bypass Protection Mechanism — An attacker can control the structure of the query, possibly causing unexpected data to be returned. This can be further used to control application flow (e.g., bypassing authentication). • Confidentiality: Read Application Data — By modifying the XPath query, an attacker could read restricted XML content by choosing which information is selected from the XML database.

Potential mitigations

• [Implementation] Use parameterized XPath queries (e.g. using XQuery). 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 XPath queries is safe in that context.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Related

Child of · CWE (2)

  • CWE-91 XML Injection weakness
  • CWE-943 Improper Neutralization of Special Elements in Data Query Logic weakness

Referenced by CVE · weakness (18)

  • CVE-2026-93434 An XPath injection vulnerability in WatchGuard Fireware OS's SSH authentication process allows a remote, unauthenticated attacker with… vulnerability
  • CVE-2026-53582 OPNsense is a FreeBSD based firewall and routing platform. vulnerability
  • CVE-2026-58395 OPNsense is a FreeBSD based firewall and routing platform. vulnerability
  • CVE-2026-11864 IBM Cloud Pak for Business Automation 26.0.0 through 26.0.0 Interim Fix 001, 25.0.0 through 25.0.0 Interim Fix 005, 24.0.1 through 24.0.1… vulnerability
  • CVE-2026-9390 XML::Sig versions before 0.71 for Perl allow XPath injection in ID lookup. vulnerability
  • CVE-2026-44962 Plesk contains an XPath injection vulnerability in the APS Application Catalog search functionality, where user-supplied input is… vulnerability
  • CVE-2026-40699 A vulnerability exists in the undisclosed pages in the Configuration utility that may allow a low-privileged authenticated attacker to… vulnerability
  • CVE-2026-24343 Improper Neutralization of Data within XPath Expressions ('XPath Injection') vulnerability in Apache HertzBeat. vulnerability
  • CVE-2025-11844 Hugging Face Smolagents version 1.20.0 contains an XPath injection vulnerability in the search_item_ctrl_f function located in… vulnerability
  • CVE-2025-20218 A vulnerability in the web-based management interface of Cisco Secure Firewall Management Center (FMC) Software could allow an… vulnerability
  • CVE-2022-43840 IBM Aspera Console 3.4.0 through 3.4.4 is vulnerable to an XPath injection vulnerability, which could allow an authenticated attacker to… vulnerability
  • CVE-2024-39565 An Improper Neutralization of Data within XPath Expressions ('XPath Injection') vulnerability in J-Web shipped with Juniper Networks Junos… vulnerability
  • CVE-2024-2645 A vulnerability classified as problematic has been found in Netentsec NS-ASG Application Security Gateway 6.3. vulnerability
  • CVE-2024-2648 A vulnerability, which was classified as problematic, was found in Netentsec NS-ASG Application Security Gateway 6.3. vulnerability
  • CVE-2023-36429 Microsoft Dynamics 365 (On-Premises) Information Disclosure Vulnerability vulnerability
  • CVE-2023-36433 Microsoft Dynamics 365 (On-Premises) Information Disclosure Vulnerability vulnerability
  • CVE-2023-24922 Microsoft Dynamics 365 (On-Premises) Information Disclosure Vulnerability vulnerability
  • CVE-2020-25162 A XPath injection vulnerability in the B. vulnerability

Referenced by CWE · has member (1)

  • CWE-1340 CISQ Data Protection Measures view

Referenced by OWASP · mapped cwe (3)