Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.xpath-injection.tainted-expression

An XPath expression is built from request input or by splicing a value into a quoted literal. An attacker can change the query and read or bypass checks on other parts of the XML document (XPath injection).

Last updated:

Suite: Security

csharp

An XPath expression is built from request input or by splicing a value into a quoted literal. An attacker can change the query and read or bypass checks on other parts of the XML document (XPath injection).

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Use a precompiled XPath expression with variables (XsltArgumentList / a custom IXsltContextVariable) or validate the value against a strict allow-list before use.

References

Source: packages/engine/rules/sast/csharp.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.