Skip to content

Commit c23938d

Browse files
authored
Merge pull request #17113 from owen-mc/go/xmlpath/add-more-package-paths
Go: add more import paths for `xmlpath`
2 parents 1a697fe + 3ccdce2 commit c23938d

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
extensions:
2+
- addsTo:
3+
pack: codeql/go-all
4+
extensible: packageGrouping
5+
data:
6+
- ["xmlpath", "gopkg.in/xmlpath"]
7+
- ["xmlpath", "github.com/go-xmlpath/xmlpath"]
8+
- ["xmlpath", "github.com/crankycoder/xmlpath"]
9+
- ["xmlpath", "launchpad.net/xmlpath"]
10+
- ["xmlpath", "github.com/masterzen/xmlpath"]
11+
- ["xmlpath", "github.com/going/toolkit/xmlpath"]
12+
- ["xmlpath", "gopkg.in/go-xmlpath/xmlpath"]
213
- addsTo:
314
pack: codeql/go-all
415
extensible: sinkModel
516
data:
6-
- ["github.com/go-xmlpath/xmlpath", "", True, "Compile", "", "", "Argument[0]", "xpath-injection", "manual"]
7-
- ["github.com/go-xmlpath/xmlpath", "", True, "MustCompile", "", "", "Argument[0]", "xpath-injection", "manual"]
17+
- ["group:xmlpath", "", True, "Compile", "", "", "Argument[0]", "xpath-injection", "manual"]
18+
- ["group:xmlpath", "", True, "MustCompile", "", "", "Argument[0]", "xpath-injection", "manual"]

go/ql/lib/semmle/go/frameworks/XPath.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ deprecated module XmlPath {
4343
* Gets the package name `github.com/go-xmlpath/xmlpath` or `gopkg.in/xmlpath`.
4444
*/
4545
deprecated string packagePath() {
46-
result = package(["github.com/go-xmlpath/xmlpath", "gopkg.in/xmlpath"], "")
46+
result =
47+
package([
48+
"github.com/go-xmlpath/xmlpath", "gopkg.in/xmlpath", "github.com/crankycoder/xmlpath",
49+
"launchpad.net/xmlpath", "github.com/masterzen/xmlpath",
50+
"github.com/going/toolkit/xmlpath", "gopkg.in/go-xmlpath/xmlpath"
51+
], "")
4752
}
4853
}

go/ql/test/query-tests/Security/CWE-643/XPathInjection.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,20 @@ models
124124
| 21 | Sink: github.com/ChrisTrenkamp/goxpath; ; true; MustParse; ; ; Argument[0]; xpath-injection; manual |
125125
| 22 | Sink: github.com/ChrisTrenkamp/goxpath; ; true; Parse; ; ; Argument[0]; xpath-injection; manual |
126126
| 23 | Sink: github.com/ChrisTrenkamp/goxpath; ; true; ParseExec; ; ; Argument[0]; xpath-injection; manual |
127+
| 24 | Sink: github.com/crankycoder/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
127128
| 24 | Sink: github.com/go-xmlpath/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
129+
| 24 | Sink: github.com/going/toolkit/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
130+
| 24 | Sink: github.com/masterzen/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
131+
| 24 | Sink: gopkg.in/go-xmlpath/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
132+
| 24 | Sink: gopkg.in/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
133+
| 24 | Sink: launchpad.net/xmlpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
134+
| 25 | Sink: github.com/crankycoder/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
128135
| 25 | Sink: github.com/go-xmlpath/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
136+
| 25 | Sink: github.com/going/toolkit/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
137+
| 25 | Sink: github.com/masterzen/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
138+
| 25 | Sink: gopkg.in/go-xmlpath/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
139+
| 25 | Sink: gopkg.in/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
140+
| 25 | Sink: launchpad.net/xmlpath; ; true; MustCompile; ; ; Argument[0]; xpath-injection; manual |
129141
| 26 | Sink: github.com/jbowtie/gokogiri/xpath; ; true; Compile; ; ; Argument[0]; xpath-injection; manual |
130142
| 27 | Sink: github.com/jbowtie/gokogiri/xml; Node; true; Search; ; ; Argument[0]; xpath-injection; manual |
131143
| 28 | Sink: github.com/jbowtie/gokogiri/xml; Node; true; SearchWithVariables; ; ; Argument[0]; xpath-injection; manual |

0 commit comments

Comments
 (0)