Skip to content

Commit 7306f58

Browse files
committed
Python: Fix experimental tests
1 parent 1d5ef38 commit 7306f58

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

python/ql/src/experimental/CWE-643/xpath.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import python
1414
import semmle.python.security.Paths
15+
import semmle.python.security.strings.Untrusted
1516
/* Sources */
1617
import semmle.python.web.HttpRequest
1718
/* Sinks */

python/ql/src/experimental/semmle/python/security/injection/Xpath.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ module XpathInjection {
2222
abstract class XpathInjectionSink extends TaintSink { }
2323

2424
/**
25-
* A Sink representing an argument to the `etree.Xpath` call.
25+
* A Sink representing an argument to the `etree.XPath` call.
2626
*
2727
* from lxml import etree
2828
* root = etree.XML("<xmlContent>")
2929
* find_text = etree.XPath("`sink`")
3030
*/
3131
private class EtreeXpathArgument extends XpathInjectionSink {
32-
override string toString() { result = "lxml.etree.Xpath" }
32+
override string toString() { result = "lxml.etree.XPath" }
3333

3434
EtreeXpathArgument() {
3535
exists(CallNode call | call.getFunction().(AttrNode).getObject("XPath").pointsTo(etree()) |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
experimental/CWE-643/Xslt.ql
1+
experimental/CWE-091/Xslt.ql
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
experimental/CWE-643/xpath.ql
1+
experimental/CWE-643/xpath.ql
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
| xpath.py:8:20:8:29 | lxml.etree.parse.xpath | externally controlled string |
2-
| xpath.py:13:29:13:38 | lxml.etree.Xpath | externally controlled string |
3-
| xpath.py:19:29:19:38 | lxml.etree.Xpath | externally controlled string |
2+
| xpath.py:13:29:13:38 | lxml.etree.XPath | externally controlled string |
3+
| xpath.py:19:29:19:38 | lxml.etree.XPath | externally controlled string |
44
| xpath.py:25:38:25:46 | lxml.etree.ETXpath | externally controlled string |
55
| xpath.py:32:29:32:34 | libxml2.parseFile.xpathEval | externally controlled string |
66
| xpathBad.py:13:20:13:43 | lxml.etree.parse.xpath | externally controlled string |
77
| xpathFlow.py:14:20:14:29 | lxml.etree.parse.xpath | externally controlled string |
8-
| xpathFlow.py:23:29:23:38 | lxml.etree.Xpath | externally controlled string |
9-
| xpathFlow.py:32:29:32:38 | lxml.etree.Xpath | externally controlled string |
8+
| xpathFlow.py:23:29:23:38 | lxml.etree.XPath | externally controlled string |
9+
| xpathFlow.py:32:29:32:38 | lxml.etree.XPath | externally controlled string |
1010
| xpathFlow.py:41:31:41:40 | lxml.etree.ETXpath | externally controlled string |
1111
| xpathFlow.py:49:29:49:38 | libxml2.parseFile.xpathEval | externally controlled string |
1212
| xpathGood.py:13:20:13:37 | lxml.etree.parse.xpath | externally controlled string |

python/ql/test/experimental/CWE-643/xpathSinks.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import python
22
import experimental.semmle.python.security.injection.Xpath
3+
import semmle.python.security.strings.Untrusted
34

45
from XpathInjection::XpathInjectionSink sink, TaintKind kind
56
where sink.sinks(kind)

0 commit comments

Comments
 (0)