File tree Expand file tree Collapse file tree
java/ql/src/semmle/code/java/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /** Provides classes to reason about XPath vulnerabilities. */
2+
3+ import java
14import semmle.code.java.dataflow.FlowSources
25import semmle.code.java.dataflow.TaintTracking
36
47/**
58 * An abstract type representing a call to interpret XPath expressions.
69 */
710class XPathSink extends MethodAccess {
11+ /**
12+ * Gets the argument representing the XPath expressions to be evaluated.
13+ */
814 abstract Expr getSink ( ) ;
915}
1016
@@ -44,10 +50,12 @@ class NodeSelectNodes extends XPathSink {
4450 override Expr getSink ( ) { result = this .getArgument ( 0 ) }
4551}
4652
53+ /** A sink that represents a method that interprets XPath expressions. */
4754class XPathInjectionSink extends DataFlow:: ExprNode {
4855 XPathInjectionSink ( ) { exists ( XPathSink sink | this .getExpr ( ) = sink .getSink ( ) ) }
4956}
5057
58+ /** A configuration that tracks data from a remote input source to a XPath evaluation sink. */
5159class XPathInjectionConfiguration extends TaintTracking:: Configuration {
5260 XPathInjectionConfiguration ( ) { this = "XPathInjection" }
5361
You can’t perform that action at this time.
0 commit comments