-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathXPath.qll
More file actions
62 lines (55 loc) · 1.92 KB
/
XPath.qll
File metadata and controls
62 lines (55 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Provides classes for working with XPath-related concepts such as XPath expressions.
*/
overlay[local?]
module;
import go
import semmle.go.dataflow.ExternalFlow
/** Provides classes for working with XPath-related APIs. */
module XPath {
/**
* A data-flow node whose string value is interpreted as (part of) an XPath expression.
*
* Extend this class to refine existing API models. If you want to model new APIs,
* extend `XPath::XPathExpressionString::Range` instead.
*/
class XPathExpressionString extends DataFlow::Node instanceof XPathExpressionString::Range { }
/** Provides classes for working with XPath expression strings. */
module XPathExpressionString {
/**
* A data-flow node whose string value is interpreted as (part of) an XPath expression.
*
* Extend this class to model new APIs. If you want to refine existing API models,
* extend `XPath::XPathExpressionString` instead.
*/
abstract class Range extends DataFlow::Node { }
private class ExternalXPathExpressionString extends Range {
ExternalXPathExpressionString() { sinkNode(this, "xpath-injection") }
}
}
/** A sanitizer for XPath injection. */
abstract class Sanitizer extends DataFlow::Node { }
private class ExternalSanitizer extends Sanitizer {
ExternalSanitizer() { barrierNode(this, "xpath-injection") }
}
}
/**
* DEPRECATED
*
* Provides classes for working with the [xmlpath](https://gopkg.in/xmlpath.v2) package.
*/
deprecated module XmlPath {
/**
* DEPRECATED
*
* Gets the package name `github.com/go-xmlpath/xmlpath` or `gopkg.in/xmlpath`.
*/
deprecated string packagePath() {
result =
package([
"github.com/go-xmlpath/xmlpath", "gopkg.in/xmlpath", "github.com/crankycoder/xmlpath",
"launchpad.net/xmlpath", "github.com/masterzen/xmlpath",
"github.com/going/toolkit/xmlpath", "gopkg.in/go-xmlpath/xmlpath"
], "")
}
}