> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# xpath-injection

> Request data is concatenated into an XPath expression.

## What it flags

Request data in the expression text passed to `select`, `select1`, `evaluate` or `parse` of the `xpath` package, for example `xpath.select("//user[name='" + req.query.name + "']", doc)` over an `@xmldom/xmldom` document. A value such as `' or '1'='1` rewrites the predicate and reads other nodes (CWE-643).

Pass the value as an XPath variable (`xpath.parse('//user[name=$name]').select({ node: doc, variables: { name } })`) or match it against an allowlist first.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "xpath-injection": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.