MIR0809
TaintedXpath
User-controlled input reaches DOMXPath::query(), DOMXPath::evaluate() or SimpleXMLElement::xpath(), risking XPath injection.
Example
Section titled “Example”<?php$xpath->query("//user[name='" . $_GET['name'] . "']"); // TaintedXpathHow to fix
Section titled “How to fix”Validate the value against a strict format, or compare it in PHP after selecting candidate nodes with a fixed expression.
