" | Cross-site scripting vulnerability due to $@. | jquery.js:2:17:2:33 | document.location | user-provided value |
| jquery.js:8:18:8:34 | "XSS: " + tainted | jquery.js:2:17:2:33 | document.location | jquery.js:8:18:8:34 | "XSS: " + tainted | Cross-site scripting vulnerability due to $@. | jquery.js:2:17:2:33 | document.location | user-provided value |
| nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` | nodemailer.js:13:50:13:66 | req.query.message | nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` | HTML injection vulnerability due to $@. | nodemailer.js:13:50:13:66 | req.query.message | user-provided value |
+| optionalSanitizer.js:6:18:6:23 | target | optionalSanitizer.js:2:16:2:32 | document.location | optionalSanitizer.js:6:18:6:23 | target | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:2:16:2:32 | document.location | user-provided value |
+| optionalSanitizer.js:9:18:9:24 | tainted | optionalSanitizer.js:2:16:2:32 | document.location | optionalSanitizer.js:9:18:9:24 | tainted | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:2:16:2:32 | document.location | user-provided value |
+| optionalSanitizer.js:17:20:17:20 | x | optionalSanitizer.js:2:16:2:32 | document.location | optionalSanitizer.js:17:20:17:20 | x | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:2:16:2:32 | document.location | user-provided value |
+| optionalSanitizer.js:32:18:32:25 | tainted2 | optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:32:18:32:25 | tainted2 | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:26:16:26:32 | document.location | user-provided value |
+| optionalSanitizer.js:36:18:36:25 | tainted2 | optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:36:18:36:25 | tainted2 | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:26:16:26:32 | document.location | user-provided value |
+| optionalSanitizer.js:39:18:39:25 | tainted3 | optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:39:18:39:25 | tainted3 | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:26:16:26:32 | document.location | user-provided value |
+| optionalSanitizer.js:43:18:43:25 | tainted3 | optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:43:18:43:25 | tainted3 | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:26:16:26:32 | document.location | user-provided value |
+| optionalSanitizer.js:45:18:45:56 | sanitiz ... target | optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:45:18:45:56 | sanitiz ... target | Cross-site scripting vulnerability due to $@. | optionalSanitizer.js:26:16:26:32 | document.location | user-provided value |
| react-native.js:8:18:8:24 | tainted | react-native.js:7:17:7:33 | req.param("code") | react-native.js:8:18:8:24 | tainted | Cross-site scripting vulnerability due to $@. | react-native.js:7:17:7:33 | req.param("code") | user-provided value |
| react-native.js:9:27:9:33 | tainted | react-native.js:7:17:7:33 | req.param("code") | react-native.js:9:27:9:33 | tainted | Cross-site scripting vulnerability due to $@. | react-native.js:7:17:7:33 | req.param("code") | user-provided value |
| stored-xss.js:5:20:5:52 | session ... ssion') | stored-xss.js:2:39:2:55 | document.location | stored-xss.js:5:20:5:52 | session ... ssion') | Cross-site scripting vulnerability due to $@. | stored-xss.js:2:39:2:55 | document.location | user-provided value |
| stored-xss.js:8:20:8:48 | localSt ... local') | stored-xss.js:3:35:3:51 | document.location | stored-xss.js:8:20:8:48 | localSt ... local') | Cross-site scripting vulnerability due to $@. | stored-xss.js:3:35:3:51 | document.location | user-provided value |
+| stored-xss.js:12:20:12:54 | "
" | stored-xss.js:3:35:3:51 | document.location | stored-xss.js:12:20:12:54 | "" | Cross-site scripting vulnerability due to $@. | stored-xss.js:3:35:3:51 | document.location | user-provided value |
| string-manipulations.js:3:16:3:32 | document.location | string-manipulations.js:3:16:3:32 | document.location | string-manipulations.js:3:16:3:32 | document.location | Cross-site scripting vulnerability due to $@. | string-manipulations.js:3:16:3:32 | document.location | user-provided value |
| string-manipulations.js:4:16:4:37 | documen ... on.href | string-manipulations.js:4:16:4:32 | document.location | string-manipulations.js:4:16:4:37 | documen ... on.href | Cross-site scripting vulnerability due to $@. | string-manipulations.js:4:16:4:32 | document.location | user-provided value |
| string-manipulations.js:5:16:5:47 | documen ... lueOf() | string-manipulations.js:5:16:5:32 | document.location | string-manipulations.js:5:16:5:47 | documen ... lueOf() | Cross-site scripting vulnerability due to $@. | string-manipulations.js:5:16:5:32 | document.location | user-provided value |
diff --git a/javascript/ql/test/query-tests/Security/CWE-079/XssWithAdditionalSources.expected b/javascript/ql/test/query-tests/Security/CWE-079/XssWithAdditionalSources.expected
index a73dae129f2..3deaa30c3aa 100644
--- a/javascript/ql/test/query-tests/Security/CWE-079/XssWithAdditionalSources.expected
+++ b/javascript/ql/test/query-tests/Security/CWE-079/XssWithAdditionalSources.expected
@@ -36,6 +36,47 @@ nodes
| nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` |
| nodemailer.js:13:50:13:66 | req.query.message |
| nodemailer.js:13:50:13:66 | req.query.message |
+| optionalSanitizer.js:2:7:2:39 | target |
+| optionalSanitizer.js:2:16:2:32 | document.location |
+| optionalSanitizer.js:2:16:2:32 | document.location |
+| optionalSanitizer.js:2:16:2:39 | documen ... .search |
+| optionalSanitizer.js:6:18:6:23 | target |
+| optionalSanitizer.js:6:18:6:23 | target |
+| optionalSanitizer.js:8:7:8:22 | tainted |
+| optionalSanitizer.js:8:17:8:22 | target |
+| optionalSanitizer.js:9:18:9:24 | tainted |
+| optionalSanitizer.js:9:18:9:24 | tainted |
+| optionalSanitizer.js:15:9:15:14 | target |
+| optionalSanitizer.js:16:18:16:18 | x |
+| optionalSanitizer.js:17:20:17:20 | x |
+| optionalSanitizer.js:17:20:17:20 | x |
+| optionalSanitizer.js:26:7:26:39 | target |
+| optionalSanitizer.js:26:16:26:32 | document.location |
+| optionalSanitizer.js:26:16:26:32 | document.location |
+| optionalSanitizer.js:26:16:26:39 | documen ... .search |
+| optionalSanitizer.js:31:7:31:23 | tainted2 |
+| optionalSanitizer.js:31:18:31:23 | target |
+| optionalSanitizer.js:32:18:32:25 | tainted2 |
+| optionalSanitizer.js:32:18:32:25 | tainted2 |
+| optionalSanitizer.js:34:5:34:36 | tainted2 |
+| optionalSanitizer.js:34:16:34:36 | sanitiz ... inted2) |
+| optionalSanitizer.js:34:28:34:35 | tainted2 |
+| optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:38:7:38:23 | tainted3 |
+| optionalSanitizer.js:38:18:38:23 | target |
+| optionalSanitizer.js:39:18:39:25 | tainted3 |
+| optionalSanitizer.js:39:18:39:25 | tainted3 |
+| optionalSanitizer.js:41:5:41:36 | tainted3 |
+| optionalSanitizer.js:41:16:41:36 | sanitiz ... inted3) |
+| optionalSanitizer.js:41:28:41:35 | tainted3 |
+| optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
+| optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
+| optionalSanitizer.js:45:29:45:47 | sanitizeBad(target) |
+| optionalSanitizer.js:45:41:45:46 | target |
+| optionalSanitizer.js:45:51:45:56 | target |
| react-native.js:7:7:7:33 | tainted |
| react-native.js:7:17:7:33 | req.param("code") |
| react-native.js:7:17:7:33 | req.param("code") |
@@ -53,6 +94,11 @@ nodes
| stored-xss.js:5:20:5:52 | session ... ssion') |
| stored-xss.js:8:20:8:48 | localSt ... local') |
| stored-xss.js:8:20:8:48 | localSt ... local') |
+| stored-xss.js:10:9:10:44 | href |
+| stored-xss.js:10:16:10:44 | localSt ... local') |
+| stored-xss.js:12:20:12:54 | "" |
+| stored-xss.js:12:20:12:54 | "" |
+| stored-xss.js:12:35:12:38 | href |
| string-manipulations.js:3:16:3:32 | document.location |
| string-manipulations.js:3:16:3:32 | document.location |
| string-manipulations.js:3:16:3:32 | document.location |
@@ -421,6 +467,51 @@ edges
| nodemailer.js:13:50:13:66 | req.query.message | nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` |
| nodemailer.js:13:50:13:66 | req.query.message | nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` |
| nodemailer.js:13:50:13:66 | req.query.message | nodemailer.js:13:11:13:69 | `Hi, yo ... sage}.` |
+| optionalSanitizer.js:2:7:2:39 | target | optionalSanitizer.js:6:18:6:23 | target |
+| optionalSanitizer.js:2:7:2:39 | target | optionalSanitizer.js:6:18:6:23 | target |
+| optionalSanitizer.js:2:7:2:39 | target | optionalSanitizer.js:8:17:8:22 | target |
+| optionalSanitizer.js:2:7:2:39 | target | optionalSanitizer.js:15:9:15:14 | target |
+| optionalSanitizer.js:2:16:2:32 | document.location | optionalSanitizer.js:2:16:2:39 | documen ... .search |
+| optionalSanitizer.js:2:16:2:32 | document.location | optionalSanitizer.js:2:16:2:39 | documen ... .search |
+| optionalSanitizer.js:2:16:2:39 | documen ... .search | optionalSanitizer.js:2:7:2:39 | target |
+| optionalSanitizer.js:8:7:8:22 | tainted | optionalSanitizer.js:9:18:9:24 | tainted |
+| optionalSanitizer.js:8:7:8:22 | tainted | optionalSanitizer.js:9:18:9:24 | tainted |
+| optionalSanitizer.js:8:17:8:22 | target | optionalSanitizer.js:8:7:8:22 | tainted |
+| optionalSanitizer.js:15:9:15:14 | target | optionalSanitizer.js:16:18:16:18 | x |
+| optionalSanitizer.js:16:18:16:18 | x | optionalSanitizer.js:17:20:17:20 | x |
+| optionalSanitizer.js:16:18:16:18 | x | optionalSanitizer.js:17:20:17:20 | x |
+| optionalSanitizer.js:26:7:26:39 | target | optionalSanitizer.js:31:18:31:23 | target |
+| optionalSanitizer.js:26:7:26:39 | target | optionalSanitizer.js:38:18:38:23 | target |
+| optionalSanitizer.js:26:7:26:39 | target | optionalSanitizer.js:45:41:45:46 | target |
+| optionalSanitizer.js:26:7:26:39 | target | optionalSanitizer.js:45:51:45:56 | target |
+| optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:26:16:26:39 | documen ... .search |
+| optionalSanitizer.js:26:16:26:32 | document.location | optionalSanitizer.js:26:16:26:39 | documen ... .search |
+| optionalSanitizer.js:26:16:26:39 | documen ... .search | optionalSanitizer.js:26:7:26:39 | target |
+| optionalSanitizer.js:31:7:31:23 | tainted2 | optionalSanitizer.js:32:18:32:25 | tainted2 |
+| optionalSanitizer.js:31:7:31:23 | tainted2 | optionalSanitizer.js:32:18:32:25 | tainted2 |
+| optionalSanitizer.js:31:7:31:23 | tainted2 | optionalSanitizer.js:34:28:34:35 | tainted2 |
+| optionalSanitizer.js:31:7:31:23 | tainted2 | optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:31:7:31:23 | tainted2 | optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:31:18:31:23 | target | optionalSanitizer.js:31:7:31:23 | tainted2 |
+| optionalSanitizer.js:34:5:34:36 | tainted2 | optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:34:5:34:36 | tainted2 | optionalSanitizer.js:36:18:36:25 | tainted2 |
+| optionalSanitizer.js:34:16:34:36 | sanitiz ... inted2) | optionalSanitizer.js:34:5:34:36 | tainted2 |
+| optionalSanitizer.js:34:28:34:35 | tainted2 | optionalSanitizer.js:34:16:34:36 | sanitiz ... inted2) |
+| optionalSanitizer.js:38:7:38:23 | tainted3 | optionalSanitizer.js:39:18:39:25 | tainted3 |
+| optionalSanitizer.js:38:7:38:23 | tainted3 | optionalSanitizer.js:39:18:39:25 | tainted3 |
+| optionalSanitizer.js:38:7:38:23 | tainted3 | optionalSanitizer.js:41:28:41:35 | tainted3 |
+| optionalSanitizer.js:38:7:38:23 | tainted3 | optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:38:7:38:23 | tainted3 | optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:38:18:38:23 | target | optionalSanitizer.js:38:7:38:23 | tainted3 |
+| optionalSanitizer.js:41:5:41:36 | tainted3 | optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:41:5:41:36 | tainted3 | optionalSanitizer.js:43:18:43:25 | tainted3 |
+| optionalSanitizer.js:41:16:41:36 | sanitiz ... inted3) | optionalSanitizer.js:41:5:41:36 | tainted3 |
+| optionalSanitizer.js:41:28:41:35 | tainted3 | optionalSanitizer.js:41:16:41:36 | sanitiz ... inted3) |
+| optionalSanitizer.js:45:29:45:47 | sanitizeBad(target) | optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
+| optionalSanitizer.js:45:29:45:47 | sanitizeBad(target) | optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
+| optionalSanitizer.js:45:41:45:46 | target | optionalSanitizer.js:45:29:45:47 | sanitizeBad(target) |
+| optionalSanitizer.js:45:51:45:56 | target | optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
+| optionalSanitizer.js:45:51:45:56 | target | optionalSanitizer.js:45:18:45:56 | sanitiz ... target |
| react-native.js:7:7:7:33 | tainted | react-native.js:8:18:8:24 | tainted |
| react-native.js:7:7:7:33 | tainted | react-native.js:8:18:8:24 | tainted |
| react-native.js:7:7:7:33 | tainted | react-native.js:9:27:9:33 | tainted |
@@ -435,6 +526,11 @@ edges
| stored-xss.js:3:35:3:51 | document.location | stored-xss.js:3:35:3:58 | documen ... .search |
| stored-xss.js:3:35:3:58 | documen ... .search | stored-xss.js:8:20:8:48 | localSt ... local') |
| stored-xss.js:3:35:3:58 | documen ... .search | stored-xss.js:8:20:8:48 | localSt ... local') |
+| stored-xss.js:3:35:3:58 | documen ... .search | stored-xss.js:10:16:10:44 | localSt ... local') |
+| stored-xss.js:10:9:10:44 | href | stored-xss.js:12:35:12:38 | href |
+| stored-xss.js:10:16:10:44 | localSt ... local') | stored-xss.js:10:9:10:44 | href |
+| stored-xss.js:12:35:12:38 | href | stored-xss.js:12:20:12:54 | "" |
+| stored-xss.js:12:35:12:38 | href | stored-xss.js:12:20:12:54 | "" |
| string-manipulations.js:3:16:3:32 | document.location | string-manipulations.js:3:16:3:32 | document.location |
| string-manipulations.js:4:16:4:32 | document.location | string-manipulations.js:4:16:4:37 | documen ... on.href |
| string-manipulations.js:4:16:4:32 | document.location | string-manipulations.js:4:16:4:37 | documen ... on.href |
diff --git a/javascript/ql/test/query-tests/Security/CWE-079/optionalSanitizer.js b/javascript/ql/test/query-tests/Security/CWE-079/optionalSanitizer.js
new file mode 100644
index 00000000000..e8139936bc7
--- /dev/null
+++ b/javascript/ql/test/query-tests/Security/CWE-079/optionalSanitizer.js
@@ -0,0 +1,46 @@
+function test() {
+ var target = document.location.search
+
+ $('myId').html(sanitize ? DOMPurify.sanitize(target) : target); // OK
+
+ $('myId').html(target); // NOT OK
+
+ var tainted = target;
+ $('myId').html(tainted); // NOT OK
+ if (sanitize) {
+ tainted = DOMPurify.sanitize(tainted);
+ }
+ $('myId').html(tainted); // OK
+
+ inner(target);
+ function inner(x) {
+ $('myId').html(x); // NOT OK
+ if (sanitize) {
+ x = DOMPurify.sanitize(x);
+ }
+ $('myId').html(x); // OK
+ }
+}
+
+function badSanitizer() {
+ var target = document.location.search
+
+ function sanitizeBad(x) {
+ return x; // No sanitization;
+ }
+ var tainted2 = target;
+ $('myId').html(tainted2); // NOT OK
+ if (sanitize) {
+ tainted2 = sanitizeBad(tainted2);
+ }
+ $('myId').html(tainted2); // NOT OK
+
+ var tainted3 = target;
+ $('myId').html(tainted3); // NOT OK
+ if (sanitize) {
+ tainted3 = sanitizeBad(tainted3);
+ }
+ $('myId').html(tainted3); // NOT OK
+
+ $('myId').html(sanitize ? sanitizeBad(target) : target); // NOT OK
+}
diff --git a/javascript/ql/test/query-tests/Security/CWE-079/stored-xss.js b/javascript/ql/test/query-tests/Security/CWE-079/stored-xss.js
index 4a9cc51bce7..6c13ae8cc3e 100644
--- a/javascript/ql/test/query-tests/Security/CWE-079/stored-xss.js
+++ b/javascript/ql/test/query-tests/Security/CWE-079/stored-xss.js
@@ -6,4 +6,25 @@
$('myId').html(localStorage.getItem('session')); // OK
$('myId').html(sessionStorage.getItem('local')); // OK
$('myId').html(localStorage.getItem('local')); // NOT OK
+
+ var href = localStorage.getItem('local');
+
+ $('myId').html("foobar"); // NOT OK
+
+ if (href.indexOf("\"") !== -1) {
+ return;
+ }
+ $('myId').html("
"); // OK
+
+ var href2 = localStorage.getItem('local');
+ if (href2.indexOf("\"") !== -1) {
+ return;
+ }
+ $('myId').html("\n
foobar"); // OK
+
+ var href3 = localStorage.getItem('local');
+ if (href3.indexOf("\"") !== -1) {
+ return;
+ }
+ $('myId').html('\r\n
' + "something" + ''); // OK
});
diff --git a/python/ql/examples/snippets/filename.ql b/python/ql/examples/snippets/filename.ql
index 579cceea47a..d0a2d122603 100644
--- a/python/ql/examples/snippets/filename.ql
+++ b/python/ql/examples/snippets/filename.ql
@@ -8,5 +8,5 @@
import python
from File f
-where f.getName() = "spam.py"
+where f.getShortName() = "spam.py"
select f
diff --git a/python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql b/python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql
index 8bf7d24b729..a0fff36b344 100644
--- a/python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql
+++ b/python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql
@@ -14,21 +14,21 @@ import python
import semmle.python.SelfAttribute
import Equality
-predicate class_stores_to_attribute(ClassObject cls, SelfAttributeStore store, string name) {
- exists(FunctionObject f |
- f = cls.declaredAttribute(_) and store.getScope() = f.getFunction() and store.getName() = name
+predicate class_stores_to_attribute(ClassValue cls, SelfAttributeStore store, string name) {
+ exists(FunctionValue f |
+ f = cls.declaredAttribute(_) and store.getScope() = f.getScope() and store.getName() = name
) and
/* Exclude classes used as metaclasses */
- not cls.getASuperType() = theTypeType()
+ not cls.getASuperType() = ClassValue::type()
}
-predicate should_override_eq(ClassObject cls, Object base_eq) {
+predicate should_override_eq(ClassValue cls, Value base_eq) {
not cls.declaresAttribute("__eq__") and
- exists(ClassObject sup | sup = cls.getABaseType() and sup.declaredAttribute("__eq__") = base_eq |
- not exists(GenericEqMethod eq | eq.getScope() = sup.getPyClass()) and
- not exists(IdentityEqMethod eq | eq.getScope() = sup.getPyClass()) and
- not base_eq.(FunctionObject).getFunction() instanceof IdentityEqMethod and
- not base_eq = theObjectType().declaredAttribute("__eq__")
+ exists(ClassValue sup | sup = cls.getABaseType() and sup.declaredAttribute("__eq__") = base_eq |
+ not exists(GenericEqMethod eq | eq.getScope() = sup.getScope()) and
+ not exists(IdentityEqMethod eq | eq.getScope() = sup.getScope()) and
+ not base_eq.(FunctionValue).getScope() instanceof IdentityEqMethod and
+ not base_eq = ClassValue::object().declaredAttribute("__eq__")
)
}
@@ -36,16 +36,16 @@ predicate should_override_eq(ClassObject cls, Object base_eq) {
* Does the non-overridden __eq__ method access the attribute,
* which implies that the __eq__ method does not need to be overridden.
*/
-predicate superclassEqExpectsAttribute(ClassObject cls, PyFunctionObject base_eq, string attrname) {
+predicate superclassEqExpectsAttribute(ClassValue cls, FunctionValue base_eq, string attrname) {
not cls.declaresAttribute("__eq__") and
- exists(ClassObject sup | sup = cls.getABaseType() and sup.declaredAttribute("__eq__") = base_eq |
+ exists(ClassValue sup | sup = cls.getABaseType() and sup.declaredAttribute("__eq__") = base_eq |
exists(SelfAttributeRead store | store.getName() = attrname |
- store.getScope() = base_eq.getFunction()
+ store.getScope() = base_eq.getScope()
)
)
}
-from ClassObject cls, SelfAttributeStore store, Object base_eq
+from ClassValue cls, SelfAttributeStore store, Value base_eq
where
class_stores_to_attribute(cls, store, _) and
should_override_eq(cls, base_eq) and
diff --git a/python/ql/src/Security/CWE-022/TarSlip.ql b/python/ql/src/Security/CWE-022/TarSlip.ql
index aedc47b92ec..5769bae409f 100644
--- a/python/ql/src/Security/CWE-022/TarSlip.ql
+++ b/python/ql/src/Security/CWE-022/TarSlip.ql
@@ -13,7 +13,7 @@
import python
import semmle.python.security.Paths
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
/** A TaintKind to represent open tarfile objects. That is, the result of calling `tarfile.open(...)` */
diff --git a/python/ql/src/Security/CWE-312/CleartextLogging.ql b/python/ql/src/Security/CWE-312/CleartextLogging.ql
index de71a56e3d3..d1c6ac94d4b 100644
--- a/python/ql/src/Security/CWE-312/CleartextLogging.ql
+++ b/python/ql/src/Security/CWE-312/CleartextLogging.ql
@@ -14,7 +14,7 @@
import python
import semmle.python.security.Paths
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.SensitiveData
import semmle.python.security.ClearText
diff --git a/python/ql/src/Security/CWE-312/CleartextStorage.ql b/python/ql/src/Security/CWE-312/CleartextStorage.ql
index 99dc8f6626c..f1f898b00dd 100644
--- a/python/ql/src/Security/CWE-312/CleartextStorage.ql
+++ b/python/ql/src/Security/CWE-312/CleartextStorage.ql
@@ -14,7 +14,7 @@
import python
import semmle.python.security.Paths
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.SensitiveData
import semmle.python.security.ClearText
diff --git a/python/ql/src/Security/CWE-798/HardcodedCredentials.ql b/python/ql/src/Security/CWE-798/HardcodedCredentials.ql
index 4f79a3382b7..edc03fb5f36 100644
--- a/python/ql/src/Security/CWE-798/HardcodedCredentials.ql
+++ b/python/ql/src/Security/CWE-798/HardcodedCredentials.ql
@@ -13,7 +13,7 @@
import python
import semmle.python.security.Paths
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.filters.Tests
class HardcodedValue extends TaintKind {
diff --git a/python/ql/src/Variables/Undefined.qll b/python/ql/src/Variables/Undefined.qll
index 78e6438ec69..2c757733af4 100644
--- a/python/ql/src/Variables/Undefined.qll
+++ b/python/ql/src/Variables/Undefined.qll
@@ -1,6 +1,6 @@
import python
import Loop
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
/** Marker for "uninitialized". */
class Uninitialized extends TaintKind {
diff --git a/python/ql/src/Variables/UndefinedExport.ql b/python/ql/src/Variables/UndefinedExport.ql
index 4d81e0f3c8d..d536e63b856 100644
--- a/python/ql/src/Variables/UndefinedExport.ql
+++ b/python/ql/src/Variables/UndefinedExport.ql
@@ -59,7 +59,7 @@ predicate contains_unknown_import_star(ModuleValue m) {
from ModuleValue m, StrConst name, string exported_name
where
declaredInAll(m.getScope(), name) and
- exported_name = name.strValue() and
+ exported_name = name.getText() and
not m.hasAttribute(exported_name) and
not is_exported_submodule_name(m, exported_name) and
not contains_unknown_import_star(m) and
diff --git a/python/ql/src/semmle/python/Exprs.qll b/python/ql/src/semmle/python/Exprs.qll
index 2b58fe38e4e..a137f4d4fb0 100644
--- a/python/ql/src/semmle/python/Exprs.qll
+++ b/python/ql/src/semmle/python/Exprs.qll
@@ -597,7 +597,7 @@ class StrConst extends Str_, ImmutableLiteral {
this.getEnclosingModule().hasFromFuture("unicode_literals")
}
- override string strValue() { result = this.getS() }
+ deprecated override string strValue() { result = this.getS() }
override Expr getASubExpression() { none() }
diff --git a/python/ql/src/semmle/python/dataflow/Configuration.qll b/python/ql/src/semmle/python/dataflow/Configuration.qll
index 851578999a8..91a9971c97d 100644
--- a/python/ql/src/semmle/python/dataflow/Configuration.qll
+++ b/python/ql/src/semmle/python/dataflow/Configuration.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
private import semmle.python.objects.ObjectInternal
private import semmle.python.dataflow.Implementation
diff --git a/python/ql/src/semmle/python/dataflow/DataFlow.qll b/python/ql/src/semmle/python/dataflow/DataFlow.qll
index 4684441563c..42eda521bc8 100644
--- a/python/ql/src/semmle/python/dataflow/DataFlow.qll
+++ b/python/ql/src/semmle/python/dataflow/DataFlow.qll
@@ -1 +1 @@
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
diff --git a/python/ql/src/semmle/python/dataflow/Files.qll b/python/ql/src/semmle/python/dataflow/Files.qll
index 467a8bec29e..a0cd1753f9d 100644
--- a/python/ql/src/semmle/python/dataflow/Files.qll
+++ b/python/ql/src/semmle/python/dataflow/Files.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
class OpenFile extends TaintKind {
OpenFile() { this = "file.open" }
diff --git a/python/ql/src/semmle/python/dataflow/Legacy.qll b/python/ql/src/semmle/python/dataflow/Legacy.qll
index 61961921514..ffdb7aee869 100644
--- a/python/ql/src/semmle/python/dataflow/Legacy.qll
+++ b/python/ql/src/semmle/python/dataflow/Legacy.qll
@@ -1,4 +1,4 @@
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
private import semmle.python.objects.ObjectInternal
import semmle.python.dataflow.Implementation
diff --git a/python/ql/src/semmle/python/objects/Callables.qll b/python/ql/src/semmle/python/objects/Callables.qll
index b915e4bd5c2..4021f04c510 100644
--- a/python/ql/src/semmle/python/objects/Callables.qll
+++ b/python/ql/src/semmle/python/objects/Callables.qll
@@ -27,8 +27,10 @@ abstract class CallableObjectInternal extends ObjectInternal {
none()
}
+ /** Gets the `n`th parameter node of this callable. */
abstract NameNode getParameter(int n);
+ /** Gets the `name`d parameter node of this callable. */
abstract NameNode getParameterByName(string name);
abstract predicate neverReturns();
@@ -438,16 +440,30 @@ class BoundMethodObjectInternal extends CallableObjectInternal, TBoundMethod {
PointsTo::pointsTo(result.getFunction(), ctx, this, _)
}
- override NameNode getParameter(int n) { result = this.getFunction().getParameter(n + 1) }
+ /** Gets the parameter node that will be used for `self`. */
+ NameNode getSelfParameter() { result = this.getFunction().getParameter(0) }
+ override NameNode getParameter(int n) {
+ result = this.getFunction().getParameter(n + 1) and
+ // don't return the parameter for `self` at `n = -1`
+ n >= 0
+ }
+
+ /**
+ * Gets the `name`d parameter node of this callable.
+ * Will not return the parameter node for `self`, instead use `getSelfParameter`.
+ */
override NameNode getParameterByName(string name) {
- result = this.getFunction().getParameterByName(name)
+ result = this.getFunction().getParameterByName(name) and
+ not result = this.getSelfParameter()
}
override predicate neverReturns() { this.getFunction().neverReturns() }
override predicate functionAndOffset(CallableObjectInternal function, int offset) {
function = this.getFunction() and offset = 1
+ or
+ function = this and offset = 0
}
override predicate useOriginAsLegacyObject() { any() }
diff --git a/python/ql/src/semmle/python/objects/ObjectAPI.qll b/python/ql/src/semmle/python/objects/ObjectAPI.qll
index 65b3326e602..320135814e1 100644
--- a/python/ql/src/semmle/python/objects/ObjectAPI.qll
+++ b/python/ql/src/semmle/python/objects/ObjectAPI.qll
@@ -352,7 +352,29 @@ class CallableValue extends Value {
result = this.(CallableObjectInternal).getParameterByName(name)
}
- /** Gets the argument corresponding to the `n'th parameter node of this callable. */
+ /**
+ * Gets the argument in `call` corresponding to the `n`'th positional parameter of this callable.
+ *
+ * Use this method instead of `call.getArg(n)` to handle the fact that this function might be used as
+ * a bound-method, such that argument `n` of the call corresponds to the `n+1` parameter of the callable.
+ *
+ * This method also gives results when the argument is passed as a keyword argument in `call`, as long
+ * as `this` is not a builtin function or a builtin method.
+ *
+ * Examples:
+ *
+ * - if `this` represents the `PythonFunctionValue` for `def func(a, b):`, and `call` represents
+ * `func(10, 20)`, then `getArgumentForCall(call, 0)` will give the `ControlFlowNode` for `10`.
+ *
+ * - with `call` representing `func(b=20, a=10)`, `getArgumentForCall(call, 0)` will give
+ * the `ControlFlowNode` for `10`.
+ *
+ * - if `this` represents the `PythonFunctionValue` for `def func(self, a, b):`, and `call`
+ * represents `foo.func(10, 20)`, then `getArgumentForCall(call, 1)` will give the
+ * `ControlFlowNode` for `10`.
+ * Note: There will also exist a `BoundMethodValue bm` where `bm.getArgumentForCall(call, 0)`
+ * will give the `ControlFlowNode` for `10` (notice the shift in index used).
+ */
cached
ControlFlowNode getArgumentForCall(CallNode call, int n) {
exists(ObjectInternal called, int offset |
@@ -363,7 +385,7 @@ class CallableValue extends Value {
or
exists(string name |
call.getArgByName(name) = result and
- this.(PythonFunctionObjectInternal).getScope().getArg(n + offset).getName() = name
+ this.getParameter(n).getId() = name
)
or
called instanceof BoundMethodObjectInternal and
@@ -373,21 +395,37 @@ class CallableValue extends Value {
)
}
- /** Gets the argument corresponding to the `name`d parameter node of this callable. */
+ /**
+ * Gets the argument in `call` corresponding to the `name`d keyword parameter of this callable.
+ *
+ * This method also gives results when the argument is passed as a positional argument in `call`, as long
+ * as `this` is not a builtin function or a builtin method.
+ *
+ * Examples:
+ *
+ * - if `this` represents the `PythonFunctionValue` for `def func(a, b):`, and `call` represents
+ * `func(10, 20)`, then `getNamedArgumentForCall(call, "a")` will give the `ControlFlowNode` for `10`.
+ *
+ * - with `call` representing `func(b=20, a=10)`, `getNamedArgumentForCall(call, "a")` will give
+ * the `ControlFlowNode` for `10`.
+ *
+ * - if `this` represents the `PythonFunctionValue` for `def func(self, a, b):`, and `call`
+ * represents `foo.func(10, 20)`, then `getNamedArgumentForCall(call, "a")` will give the
+ * `ControlFlowNode` for `10`.
+ */
cached
ControlFlowNode getNamedArgumentForCall(CallNode call, string name) {
exists(CallableObjectInternal called, int offset |
PointsToInternal::pointsTo(call.getFunction(), _, called, _) and
called.functionAndOffset(this, offset)
|
+ call.getArgByName(name) = result
+ or
exists(int n |
call.getArg(n) = result and
- this.(PythonFunctionObjectInternal).getScope().getArg(n + offset).getName() = name
+ this.getParameter(n + offset).getId() = name
)
or
- call.getArgByName(name) = result and
- exists(this.(PythonFunctionObjectInternal).getScope().getArgByName(name))
- or
called instanceof BoundMethodObjectInternal and
offset = 1 and
name = "self" and
@@ -396,6 +434,29 @@ class CallableValue extends Value {
}
}
+/**
+ * Class representing bound-methods, such as `o.func`, where `o` is an instance
+ * of a class that has a callable attribute `func`.
+ */
+class BoundMethodValue extends CallableValue {
+ BoundMethodValue() { this instanceof BoundMethodObjectInternal }
+
+ /**
+ * Gets the callable that will be used when `this` is called.
+ * The actual callable for `func` in `o.func`.
+ */
+ CallableValue getFunction() { result = this.(BoundMethodObjectInternal).getFunction() }
+
+ /**
+ * Gets the value that will be used for the `self` parameter when `this` is called.
+ * The value for `o` in `o.func`.
+ */
+ Value getSelf() { result = this.(BoundMethodObjectInternal).getSelf() }
+
+ /** Gets the parameter node that will be used for `self`. */
+ NameNode getSelfParameter() { result = this.(BoundMethodObjectInternal).getSelfParameter() }
+}
+
/**
* Class representing classes in the Python program, both Python and built-in.
*/
@@ -663,11 +724,13 @@ class PythonFunctionValue extends FunctionValue {
ControlFlowNode getAReturnedNode() { result = this.getScope().getAReturnValueFlowNode() }
override ClassValue getARaisedType() { scope_raises(result, this.getScope()) }
-
+
override ClassValue getAnInferredReturnType() {
- /* We have to do a special version of this because builtin functions have no
+ /*
+ * We have to do a special version of this because builtin functions have no
* explicit return nodes that we can query and get the class of.
*/
+
result = this.getAReturnedNode().pointsTo().getClass()
}
}
@@ -690,9 +753,11 @@ class BuiltinFunctionValue extends FunctionValue {
}
override ClassValue getAnInferredReturnType() {
- /* We have to do a special version of this because builtin functions have no
+ /*
+ * We have to do a special version of this because builtin functions have no
* explicit return nodes that we can query and get the class of.
*/
+
result = TBuiltinClassObject(this.(BuiltinFunctionObjectInternal).getReturnType())
}
}
@@ -719,7 +784,7 @@ class BuiltinMethodValue extends FunctionValue {
/* Information is unavailable for C code in general */
none()
}
-
+
override ClassValue getAnInferredReturnType() {
result = TBuiltinClassObject(this.(BuiltinMethodObjectInternal).getReturnType())
}
diff --git a/python/ql/src/semmle/python/security/ClearText.qll b/python/ql/src/semmle/python/security/ClearText.qll
index d08d2b03883..a26e33218dd 100644
--- a/python/ql/src/semmle/python/security/ClearText.qll
+++ b/python/ql/src/semmle/python/security/ClearText.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.SensitiveData
import semmle.python.dataflow.Files
import semmle.python.web.Http
diff --git a/python/ql/src/semmle/python/security/Crypto.qll b/python/ql/src/semmle/python/security/Crypto.qll
index 06244851018..98ec8ecb2f1 100644
--- a/python/ql/src/semmle/python/security/Crypto.qll
+++ b/python/ql/src/semmle/python/security/Crypto.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
private import semmle.python.security.SensitiveData
private import semmle.crypto.Crypto as CryptoLib
diff --git a/python/ql/src/semmle/python/security/Exceptions.qll b/python/ql/src/semmle/python/security/Exceptions.qll
index 5344808caac..4288761c565 100644
--- a/python/ql/src/semmle/python/security/Exceptions.qll
+++ b/python/ql/src/semmle/python/security/Exceptions.qll
@@ -4,7 +4,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
private Value traceback_function(string name) { result = Module::named("traceback").attr(name) }
diff --git a/python/ql/src/semmle/python/security/SQL.qll b/python/ql/src/semmle/python/security/SQL.qll
index a09d74134e6..4d2ef6218cc 100644
--- a/python/ql/src/semmle/python/security/SQL.qll
+++ b/python/ql/src/semmle/python/security/SQL.qll
@@ -1,4 +1,4 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
abstract class SqlInjectionSink extends TaintSink { }
diff --git a/python/ql/src/semmle/python/security/SensitiveData.qll b/python/ql/src/semmle/python/security/SensitiveData.qll
index 6e0b44d3c33..18e52423d19 100644
--- a/python/ql/src/semmle/python/security/SensitiveData.qll
+++ b/python/ql/src/semmle/python/security/SensitiveData.qll
@@ -10,7 +10,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.HttpRequest
/**
diff --git a/python/ql/src/semmle/python/security/injection/Command.qll b/python/ql/src/semmle/python/security/injection/Command.qll
index 1a6c2508719..3084f2c8cf4 100644
--- a/python/ql/src/semmle/python/security/injection/Command.qll
+++ b/python/ql/src/semmle/python/security/injection/Command.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
/** Abstract taint sink that is potentially vulnerable to malicious shell commands. */
diff --git a/python/ql/src/semmle/python/security/injection/Deserialization.qll b/python/ql/src/semmle/python/security/injection/Deserialization.qll
index 14bf9d2233d..1f73ede22f2 100644
--- a/python/ql/src/semmle/python/security/injection/Deserialization.qll
+++ b/python/ql/src/semmle/python/security/injection/Deserialization.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
/** `pickle.loads(untrusted)` vulnerability. */
abstract class DeserializationSink extends TaintSink {
diff --git a/python/ql/src/semmle/python/security/injection/Exec.qll b/python/ql/src/semmle/python/security/injection/Exec.qll
index 59ed181023a..462847e7d3e 100644
--- a/python/ql/src/semmle/python/security/injection/Exec.qll
+++ b/python/ql/src/semmle/python/security/injection/Exec.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
/**
diff --git a/python/ql/src/semmle/python/security/injection/Marshal.qll b/python/ql/src/semmle/python/security/injection/Marshal.qll
index 274392c8b4f..7ae77e597a5 100644
--- a/python/ql/src/semmle/python/security/injection/Marshal.qll
+++ b/python/ql/src/semmle/python/security/injection/Marshal.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.injection.Deserialization
diff --git a/python/ql/src/semmle/python/security/injection/Path.qll b/python/ql/src/semmle/python/security/injection/Path.qll
index 02c0eb12697..e871d11cf2b 100644
--- a/python/ql/src/semmle/python/security/injection/Path.qll
+++ b/python/ql/src/semmle/python/security/injection/Path.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
/**
diff --git a/python/ql/src/semmle/python/security/injection/Pickle.qll b/python/ql/src/semmle/python/security/injection/Pickle.qll
index 2d56bc25f8e..1135587df50 100644
--- a/python/ql/src/semmle/python/security/injection/Pickle.qll
+++ b/python/ql/src/semmle/python/security/injection/Pickle.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.injection.Deserialization
diff --git a/python/ql/src/semmle/python/security/injection/Sql.qll b/python/ql/src/semmle/python/security/injection/Sql.qll
index 38c0eaec7d7..7fc9515c08b 100644
--- a/python/ql/src/semmle/python/security/injection/Sql.qll
+++ b/python/ql/src/semmle/python/security/injection/Sql.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.SQL
diff --git a/python/ql/src/semmle/python/security/injection/Xml.qll b/python/ql/src/semmle/python/security/injection/Xml.qll
index 080df3067d0..3a4e6ebc552 100644
--- a/python/ql/src/semmle/python/security/injection/Xml.qll
+++ b/python/ql/src/semmle/python/security/injection/Xml.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.injection.Deserialization
diff --git a/python/ql/src/semmle/python/security/injection/Yaml.qll b/python/ql/src/semmle/python/security/injection/Yaml.qll
index 3b0156b2812..0799d9b9160 100644
--- a/python/ql/src/semmle/python/security/injection/Yaml.qll
+++ b/python/ql/src/semmle/python/security/injection/Yaml.qll
@@ -7,7 +7,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.injection.Deserialization
diff --git a/python/ql/src/semmle/python/security/strings/Basic.qll b/python/ql/src/semmle/python/security/strings/Basic.qll
index 1eed2bb327a..cb2178addde 100755
--- a/python/ql/src/semmle/python/security/strings/Basic.qll
+++ b/python/ql/src/semmle/python/security/strings/Basic.qll
@@ -1,6 +1,6 @@
import python
private import Common
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
/** An extensible kind of taint representing any kind of string. */
abstract class StringKind extends TaintKind {
diff --git a/python/ql/src/semmle/python/types/ModuleObject.qll b/python/ql/src/semmle/python/types/ModuleObject.qll
index 3b5d15c41b1..644d4e60244 100644
--- a/python/ql/src/semmle/python/types/ModuleObject.qll
+++ b/python/ql/src/semmle/python/types/ModuleObject.qll
@@ -118,7 +118,7 @@ class BuiltinModuleObject extends ModuleObject {
override predicate hasAttribute(string name) { exists(this.asBuiltin().getMember(name)) }
- override predicate exportsComplete() { any() }
+ deprecated override predicate exportsComplete() { any() }
}
class PythonModuleObject extends ModuleObject {
@@ -132,7 +132,7 @@ class PythonModuleObject extends ModuleObject {
override Container getPath() { result = this.getModule().getFile() }
- override predicate exportsComplete() {
+ deprecated override predicate exportsComplete() {
exists(Module m | m = this.getModule() |
not exists(Call modify, Attribute attr, GlobalVariable all |
modify.getScope() = m and
@@ -196,7 +196,7 @@ class PackageObject extends ModuleObject {
)
}
- override predicate exportsComplete() {
+ deprecated override predicate exportsComplete() {
not exists(this.getInitModule())
or
this.getInitModule().exportsComplete()
diff --git a/python/ql/src/semmle/python/web/bottle/Redirect.qll b/python/ql/src/semmle/python/web/bottle/Redirect.qll
index 187839f30e8..be4c552fea2 100644
--- a/python/ql/src/semmle/python/web/bottle/Redirect.qll
+++ b/python/ql/src/semmle/python/web/bottle/Redirect.qll
@@ -5,7 +5,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.bottle.General
diff --git a/python/ql/src/semmle/python/web/bottle/Request.qll b/python/ql/src/semmle/python/web/bottle/Request.qll
index 585336ac65a..10d2b223863 100644
--- a/python/ql/src/semmle/python/web/bottle/Request.qll
+++ b/python/ql/src/semmle/python/web/bottle/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.web.Http
import semmle.python.web.bottle.General
diff --git a/python/ql/src/semmle/python/web/bottle/Response.qll b/python/ql/src/semmle/python/web/bottle/Response.qll
index 7dd53377a8c..dede231c27d 100644
--- a/python/ql/src/semmle/python/web/bottle/Response.qll
+++ b/python/ql/src/semmle/python/web/bottle/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.web.Http
import semmle.python.web.bottle.General
diff --git a/python/ql/src/semmle/python/web/cherrypy/Request.qll b/python/ql/src/semmle/python/web/cherrypy/Request.qll
index 2440a2710f6..309d51f5539 100644
--- a/python/ql/src/semmle/python/web/cherrypy/Request.qll
+++ b/python/ql/src/semmle/python/web/cherrypy/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
import semmle.python.web.cherrypy.General
diff --git a/python/ql/src/semmle/python/web/cherrypy/Response.qll b/python/ql/src/semmle/python/web/cherrypy/Response.qll
index 7702b8ce500..3ed1d0d9b57 100644
--- a/python/ql/src/semmle/python/web/cherrypy/Response.qll
+++ b/python/ql/src/semmle/python/web/cherrypy/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.web.Http
import semmle.python.web.cherrypy.General
diff --git a/python/ql/src/semmle/python/web/django/Model.qll b/python/ql/src/semmle/python/web/django/Model.qll
index b8f47b64bdf..f8a61bda10e 100644
--- a/python/ql/src/semmle/python/web/django/Model.qll
+++ b/python/ql/src/semmle/python/web/django/Model.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
import semmle.python.security.injection.Sql
diff --git a/python/ql/src/semmle/python/web/django/Redirect.qll b/python/ql/src/semmle/python/web/django/Redirect.qll
index a550088eaf6..67342517a99 100644
--- a/python/ql/src/semmle/python/web/django/Redirect.qll
+++ b/python/ql/src/semmle/python/web/django/Redirect.qll
@@ -5,7 +5,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
private import semmle.python.web.django.Shared
private import semmle.python.web.Http
diff --git a/python/ql/src/semmle/python/web/django/Request.qll b/python/ql/src/semmle/python/web/django/Request.qll
index e054407fcee..503264c2817 100644
--- a/python/ql/src/semmle/python/web/django/Request.qll
+++ b/python/ql/src/semmle/python/web/django/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import semmle.python.web.django.General
diff --git a/python/ql/src/semmle/python/web/django/Response.qll b/python/ql/src/semmle/python/web/django/Response.qll
index dc6a3634440..35d8cd63553 100644
--- a/python/ql/src/semmle/python/web/django/Response.qll
+++ b/python/ql/src/semmle/python/web/django/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
private import semmle.python.web.django.Shared
private import semmle.python.web.Http
diff --git a/python/ql/src/semmle/python/web/falcon/Request.qll b/python/ql/src/semmle/python/web/falcon/Request.qll
index 13f3fa4c441..66707b01d0c 100644
--- a/python/ql/src/semmle/python/web/falcon/Request.qll
+++ b/python/ql/src/semmle/python/web/falcon/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import semmle.python.web.falcon.General
import semmle.python.security.strings.External
diff --git a/python/ql/src/semmle/python/web/falcon/Response.qll b/python/ql/src/semmle/python/web/falcon/Response.qll
index ab7798cc2cb..c66a6315ce5 100644
--- a/python/ql/src/semmle/python/web/falcon/Response.qll
+++ b/python/ql/src/semmle/python/web/falcon/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import semmle.python.web.falcon.General
import semmle.python.security.strings.External
diff --git a/python/ql/src/semmle/python/web/flask/Redirect.qll b/python/ql/src/semmle/python/web/flask/Redirect.qll
index f01f13f6ef7..4c4e289c605 100644
--- a/python/ql/src/semmle/python/web/flask/Redirect.qll
+++ b/python/ql/src/semmle/python/web/flask/Redirect.qll
@@ -5,7 +5,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.flask.General
diff --git a/python/ql/src/semmle/python/web/flask/Request.qll b/python/ql/src/semmle/python/web/flask/Request.qll
index 7e2650a1ca0..5548e409c32 100644
--- a/python/ql/src/semmle/python/web/flask/Request.qll
+++ b/python/ql/src/semmle/python/web/flask/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import semmle.python.web.flask.General
diff --git a/python/ql/src/semmle/python/web/flask/Response.qll b/python/ql/src/semmle/python/web/flask/Response.qll
index 0828c180e9a..e070f19b1f6 100644
--- a/python/ql/src/semmle/python/web/flask/Response.qll
+++ b/python/ql/src/semmle/python/web/flask/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.flask.General
diff --git a/python/ql/src/semmle/python/web/pyramid/Redirect.qll b/python/ql/src/semmle/python/web/pyramid/Redirect.qll
index 8c7e57a4285..2ab68b40621 100644
--- a/python/ql/src/semmle/python/web/pyramid/Redirect.qll
+++ b/python/ql/src/semmle/python/web/pyramid/Redirect.qll
@@ -5,7 +5,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
diff --git a/python/ql/src/semmle/python/web/pyramid/Request.qll b/python/ql/src/semmle/python/web/pyramid/Request.qll
index dc5be31e68a..f3422b682d6 100644
--- a/python/ql/src/semmle/python/web/pyramid/Request.qll
+++ b/python/ql/src/semmle/python/web/pyramid/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
private import semmle.python.web.webob.Request
private import semmle.python.web.pyramid.View
diff --git a/python/ql/src/semmle/python/web/pyramid/Response.qll b/python/ql/src/semmle/python/web/pyramid/Response.qll
index 37dc4be783c..c51a437350d 100644
--- a/python/ql/src/semmle/python/web/pyramid/Response.qll
+++ b/python/ql/src/semmle/python/web/pyramid/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
private import semmle.python.web.pyramid.View
diff --git a/python/ql/src/semmle/python/web/stdlib/Request.qll b/python/ql/src/semmle/python/web/stdlib/Request.qll
index ce150371279..459a5091389 100644
--- a/python/ql/src/semmle/python/web/stdlib/Request.qll
+++ b/python/ql/src/semmle/python/web/stdlib/Request.qll
@@ -4,7 +4,7 @@
* (or subclasses) and form parsing using `cgi.FieldStorage`.
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
/** Source of BaseHTTPRequestHandler instances. */
diff --git a/python/ql/src/semmle/python/web/stdlib/Response.qll b/python/ql/src/semmle/python/web/stdlib/Response.qll
index fb056d49525..58949e0a6d9 100644
--- a/python/ql/src/semmle/python/web/stdlib/Response.qll
+++ b/python/ql/src/semmle/python/web/stdlib/Response.qll
@@ -3,7 +3,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
private predicate is_wfile(AttrNode wfile) {
diff --git a/python/ql/src/semmle/python/web/tornado/Redirect.qll b/python/ql/src/semmle/python/web/tornado/Redirect.qll
index 2d2c39907eb..f846f113816 100644
--- a/python/ql/src/semmle/python/web/tornado/Redirect.qll
+++ b/python/ql/src/semmle/python/web/tornado/Redirect.qll
@@ -5,7 +5,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
import Tornado
diff --git a/python/ql/src/semmle/python/web/tornado/Request.qll b/python/ql/src/semmle/python/web/tornado/Request.qll
index 66c77d4f269..cfb7bfa7b04 100644
--- a/python/ql/src/semmle/python/web/tornado/Request.qll
+++ b/python/ql/src/semmle/python/web/tornado/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import Tornado
diff --git a/python/ql/src/semmle/python/web/tornado/Response.qll b/python/ql/src/semmle/python/web/tornado/Response.qll
index 2c2da1a4c70..b9213ac8446 100644
--- a/python/ql/src/semmle/python/web/tornado/Response.qll
+++ b/python/ql/src/semmle/python/web/tornado/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
private import semmle.python.web.Http
import Tornado
diff --git a/python/ql/src/semmle/python/web/tornado/Tornado.qll b/python/ql/src/semmle/python/web/tornado/Tornado.qll
index 10a5c5be962..d9f6ab823b9 100644
--- a/python/ql/src/semmle/python/web/tornado/Tornado.qll
+++ b/python/ql/src/semmle/python/web/tornado/Tornado.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
private ClassValue theTornadoRequestHandlerClass() {
diff --git a/python/ql/src/semmle/python/web/turbogears/Response.qll b/python/ql/src/semmle/python/web/turbogears/Response.qll
index cab083bf8b7..307806dc485 100644
--- a/python/ql/src/semmle/python/web/turbogears/Response.qll
+++ b/python/ql/src/semmle/python/web/turbogears/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Basic
import semmle.python.web.Http
import TurboGears
diff --git a/python/ql/src/semmle/python/web/turbogears/TurboGears.qll b/python/ql/src/semmle/python/web/turbogears/TurboGears.qll
index 1cef2f51c84..547a6c0e505 100644
--- a/python/ql/src/semmle/python/web/turbogears/TurboGears.qll
+++ b/python/ql/src/semmle/python/web/turbogears/TurboGears.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
private ClassValue theTurboGearsControllerClass() { result = Value::named("tg.TGController") }
diff --git a/python/ql/src/semmle/python/web/twisted/Request.qll b/python/ql/src/semmle/python/web/twisted/Request.qll
index 969392d0eef..0be6fc78f2c 100644
--- a/python/ql/src/semmle/python/web/twisted/Request.qll
+++ b/python/ql/src/semmle/python/web/twisted/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import Twisted
diff --git a/python/ql/src/semmle/python/web/twisted/Response.qll b/python/ql/src/semmle/python/web/twisted/Response.qll
index b7f67ff6b20..be32ba08188 100644
--- a/python/ql/src/semmle/python/web/twisted/Response.qll
+++ b/python/ql/src/semmle/python/web/twisted/Response.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
import semmle.python.security.strings.Basic
import Twisted
diff --git a/python/ql/src/semmle/python/web/twisted/Twisted.qll b/python/ql/src/semmle/python/web/twisted/Twisted.qll
index e3b0ab0f9be..9ecd12b9620 100644
--- a/python/ql/src/semmle/python/web/twisted/Twisted.qll
+++ b/python/ql/src/semmle/python/web/twisted/Twisted.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
private ClassValue theTwistedHttpRequestClass() {
result = Value::named("twisted.web.http.Request")
diff --git a/python/ql/src/semmle/python/web/webob/Request.qll b/python/ql/src/semmle/python/web/webob/Request.qll
index 70fa311f6b0..4d6e98bb2e9 100644
--- a/python/ql/src/semmle/python/web/webob/Request.qll
+++ b/python/ql/src/semmle/python/web/webob/Request.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.Http
abstract class BaseWebobRequest extends TaintKind {
diff --git a/python/ql/src/semmle/python/xml/XML.qll b/python/ql/src/semmle/python/xml/XML.qll
index dc7836aaabe..713903b63e6 100755
--- a/python/ql/src/semmle/python/xml/XML.qll
+++ b/python/ql/src/semmle/python/xml/XML.qll
@@ -116,7 +116,7 @@ class XMLFile extends XMLParent, File {
XMLFile() { xmlEncoding(this, _) }
/** Gets a printable representation of this XML file. */
- override string toString() { result = XMLParent.super.toString() }
+ override string toString() { result = getName() }
/** Gets the name of this XML file. */
override string getName() { result = File.super.getAbsolutePath() }
@@ -236,7 +236,7 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
string getAttributeValue(string name) { result = this.getAttribute(name).getValue() }
/** Gets a printable representation of this XML element. */
- override string toString() { result = XMLParent.super.toString() }
+ override string toString() { result = getName() }
}
/**
diff --git a/python/ql/test/3/library-tests/taint/unpacking/Taint.qll b/python/ql/test/3/library-tests/taint/unpacking/Taint.qll
index b97f65225f2..21e16aabac5 100644
--- a/python/ql/test/3/library-tests/taint/unpacking/Taint.qll
+++ b/python/ql/test/3/library-tests/taint/unpacking/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class SimpleSource extends TaintSource {
diff --git a/python/ql/test/3/library-tests/taint/unpacking/TestTaint.ql b/python/ql/test/3/library-tests/taint/unpacking/TestTaint.ql
index 8347bd25433..fb1d102aa7a 100644
--- a/python/ql/test/3/library-tests/taint/unpacking/TestTaint.ql
+++ b/python/ql/test/3/library-tests/taint/unpacking/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/3/query-tests/Classes/equals-attr/DefineEqualsWhenAddingAttributes.expected b/python/ql/test/3/query-tests/Classes/equals-attr/DefineEqualsWhenAddingAttributes.expected
index 8f5f5e7b762..8843b6d52ef 100644
--- a/python/ql/test/3/query-tests/Classes/equals-attr/DefineEqualsWhenAddingAttributes.expected
+++ b/python/ql/test/3/query-tests/Classes/equals-attr/DefineEqualsWhenAddingAttributes.expected
@@ -1,2 +1,2 @@
-| test.py:12:1:12:24 | class C | The class 'C' does not override $@, but adds the new attribute $@. | test.py:9:5:9:28 | Function __eq__ | '__eq__' | test.py:15:9:15:14 | Attribute | a |
-| test.py:12:1:12:24 | class C | The class 'C' does not override $@, but adds the new attribute $@. | test.py:9:5:9:28 | Function __eq__ | '__eq__' | test.py:15:17:15:22 | Attribute | b |
+| test.py:12:1:12:24 | class C | The class 'C' does not override $@, but adds the new attribute $@. | test.py:9:5:9:28 | Function RedefineEquals.__eq__ | '__eq__' | test.py:15:9:15:14 | Attribute | a |
+| test.py:12:1:12:24 | class C | The class 'C' does not override $@, but adds the new attribute $@. | test.py:9:5:9:28 | Function RedefineEquals.__eq__ | '__eq__' | test.py:15:17:15:22 | Attribute | b |
diff --git a/python/ql/test/library-tests/PointsTo/calls/Argument.expected b/python/ql/test/library-tests/PointsTo/calls/Argument.expected
deleted file mode 100644
index dbc7e586f47..00000000000
--- a/python/ql/test/library-tests/PointsTo/calls/Argument.expected
+++ /dev/null
@@ -1,15 +0,0 @@
-| 19 | 0 | ControlFlowNode for w | Function f |
-| 19 | 1 | ControlFlowNode for x | Function f |
-| 19 | 2 | ControlFlowNode for y | Function f |
-| 21 | 0 | ControlFlowNode for y | Function f |
-| 21 | 1 | ControlFlowNode for w | Function f |
-| 21 | 2 | ControlFlowNode for z | Function f |
-| 23 | 0 | ControlFlowNode for c | Function f |
-| 23 | 1 | ControlFlowNode for w | Function f |
-| 23 | 2 | ControlFlowNode for z | Function f |
-| 24 | 0 | ControlFlowNode for c | Function n |
-| 24 | 1 | ControlFlowNode for x | Function n |
-| 25 | 0 | ControlFlowNode for y | Function n |
-| 25 | 1 | ControlFlowNode for z | Function n |
-| 33 | 0 | ControlFlowNode for IntegerLiteral | Function foo |
-| 34 | 0 | ControlFlowNode for IntegerLiteral | Function foo |
diff --git a/python/ql/test/library-tests/PointsTo/calls/Argument.ql b/python/ql/test/library-tests/PointsTo/calls/Argument.ql
deleted file mode 100644
index 1678c02c182..00000000000
--- a/python/ql/test/library-tests/PointsTo/calls/Argument.ql
+++ /dev/null
@@ -1,5 +0,0 @@
-import python
-
-from ControlFlowNode arg, FunctionObject func, int i
-where arg = func.getArgumentForCall(_, i)
-select arg.getLocation().getStartLine(), i, arg.toString(), func.toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/Call.expected b/python/ql/test/library-tests/PointsTo/calls/Call.expected
deleted file mode 100644
index 9e9c5646d89..00000000000
--- a/python/ql/test/library-tests/PointsTo/calls/Call.expected
+++ /dev/null
@@ -1,7 +0,0 @@
-| 19 | ControlFlowNode for f() | Function f |
-| 21 | ControlFlowNode for f() | Function f |
-| 23 | ControlFlowNode for Attribute() | Function f |
-| 24 | ControlFlowNode for Attribute() | Function n |
-| 25 | ControlFlowNode for Attribute() | Function n |
-| 33 | ControlFlowNode for Attribute() | Function foo |
-| 34 | ControlFlowNode for Attribute() | Function foo |
diff --git a/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.expected b/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.expected
new file mode 100644
index 00000000000..05c4d41406e
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.expected
@@ -0,0 +1,19 @@
+| 19 | ControlFlowNode for f() | Function f |
+| 21 | ControlFlowNode for f() | Function f |
+| 22 | ControlFlowNode for C() | class C |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) |
+| 24 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
+| 25 | ControlFlowNode for Attribute() | Function C.n |
+| 29 | ControlFlowNode for staticmethod() | builtin-class staticmethod |
+| 33 | ControlFlowNode for Attribute() | Function D.foo |
+| 34 | ControlFlowNode for Attribute() | Function D.foo |
+| 34 | ControlFlowNode for D() | class D |
+| 37 | ControlFlowNode for Attribute() | Method(builtin method append, List) |
+| 38 | ControlFlowNode for len() | Builtin-function len |
+| 40 | ControlFlowNode for f() | Function f |
+| 41 | ControlFlowNode for C() | class C |
+| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
+| 45 | ControlFlowNode for open() | Builtin-function open |
+| 46 | ControlFlowNode for open() | Builtin-function open |
+| 51 | ControlFlowNode for foo() | Function foo |
+| 55 | ControlFlowNode for bar() | Function bar |
diff --git a/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.ql b/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.ql
new file mode 100644
index 00000000000..10247a98f94
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/CallPointsTo.ql
@@ -0,0 +1,5 @@
+import python
+
+from CallNode call, Value func
+where call.getFunction().pointsTo(func)
+select call.getLocation().getStartLine(), call.toString(), func.toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/GetACall.expected b/python/ql/test/library-tests/PointsTo/calls/GetACall.expected
new file mode 100644
index 00000000000..c9b7822b278
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/GetACall.expected
@@ -0,0 +1,23 @@
+| 19 | ControlFlowNode for f() | Function f |
+| 21 | ControlFlowNode for f() | Function f |
+| 22 | ControlFlowNode for C() | class C |
+| 23 | ControlFlowNode for Attribute() | Function f |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) |
+| 24 | ControlFlowNode for Attribute() | Function C.n |
+| 24 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
+| 25 | ControlFlowNode for Attribute() | Function C.n |
+| 29 | ControlFlowNode for staticmethod() | builtin-class staticmethod |
+| 33 | ControlFlowNode for Attribute() | Function D.foo |
+| 34 | ControlFlowNode for Attribute() | Function D.foo |
+| 34 | ControlFlowNode for D() | class D |
+| 37 | ControlFlowNode for Attribute() | Method(builtin method append, List) |
+| 37 | ControlFlowNode for Attribute() | builtin method append |
+| 38 | ControlFlowNode for len() | Builtin-function len |
+| 40 | ControlFlowNode for f() | Function f |
+| 41 | ControlFlowNode for C() | class C |
+| 42 | ControlFlowNode for Attribute() | Function C.n |
+| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
+| 45 | ControlFlowNode for open() | Builtin-function open |
+| 46 | ControlFlowNode for open() | Builtin-function open |
+| 51 | ControlFlowNode for foo() | Function foo |
+| 55 | ControlFlowNode for bar() | Function bar |
diff --git a/python/ql/test/library-tests/PointsTo/calls/Call.ql b/python/ql/test/library-tests/PointsTo/calls/GetACall.ql
similarity index 71%
rename from python/ql/test/library-tests/PointsTo/calls/Call.ql
rename to python/ql/test/library-tests/PointsTo/calls/GetACall.ql
index 94c4212cc64..84f2ab4fb4a 100644
--- a/python/ql/test/library-tests/PointsTo/calls/Call.ql
+++ b/python/ql/test/library-tests/PointsTo/calls/GetACall.ql
@@ -1,5 +1,5 @@
import python
-from ControlFlowNode call, FunctionObject func
+from ControlFlowNode call, Value func
where call = func.getACall()
select call.getLocation().getStartLine(), call.toString(), func.toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.expected b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.expected
new file mode 100644
index 00000000000..c834c72049f
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.expected
@@ -0,0 +1,34 @@
+| 19 | ControlFlowNode for f() | Function f | 0 | ControlFlowNode for w |
+| 19 | ControlFlowNode for f() | Function f | 1 | ControlFlowNode for x |
+| 19 | ControlFlowNode for f() | Function f | 2 | ControlFlowNode for y |
+| 21 | ControlFlowNode for f() | Function f | 0 | ControlFlowNode for y |
+| 21 | ControlFlowNode for f() | Function f | 1 | ControlFlowNode for w |
+| 21 | ControlFlowNode for f() | Function f | 2 | ControlFlowNode for z |
+| 23 | ControlFlowNode for Attribute() | Function f | 0 | ControlFlowNode for c |
+| 23 | ControlFlowNode for Attribute() | Function f | 1 | ControlFlowNode for w |
+| 23 | ControlFlowNode for Attribute() | Function f | 2 | ControlFlowNode for z |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) | 0 | ControlFlowNode for w |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) | 1 | ControlFlowNode for z |
+| 24 | ControlFlowNode for Attribute() | Function C.n | 0 | ControlFlowNode for c |
+| 24 | ControlFlowNode for Attribute() | Function C.n | 1 | ControlFlowNode for x |
+| 24 | ControlFlowNode for Attribute() | Method(Function C.n, C()) | 0 | ControlFlowNode for x |
+| 25 | ControlFlowNode for Attribute() | Function C.n | 0 | ControlFlowNode for y |
+| 25 | ControlFlowNode for Attribute() | Function C.n | 1 | ControlFlowNode for z |
+| 33 | ControlFlowNode for Attribute() | Function D.foo | 0 | ControlFlowNode for IntegerLiteral |
+| 34 | ControlFlowNode for Attribute() | Function D.foo | 0 | ControlFlowNode for IntegerLiteral |
+| 37 | ControlFlowNode for Attribute() | Method(builtin method append, List) | 0 | ControlFlowNode for IntegerLiteral |
+| 37 | ControlFlowNode for Attribute() | builtin method append | 0 | ControlFlowNode for l |
+| 37 | ControlFlowNode for Attribute() | builtin method append | 1 | ControlFlowNode for IntegerLiteral |
+| 38 | ControlFlowNode for len() | Builtin-function len | 0 | ControlFlowNode for l |
+| 40 | ControlFlowNode for f() | Function f | 0 | ControlFlowNode for IntegerLiteral |
+| 40 | ControlFlowNode for f() | Function f | 1 | ControlFlowNode for IntegerLiteral |
+| 40 | ControlFlowNode for f() | Function f | 2 | ControlFlowNode for IntegerLiteral |
+| 42 | ControlFlowNode for Attribute() | Function C.n | 0 | ControlFlowNode for c |
+| 42 | ControlFlowNode for Attribute() | Function C.n | 1 | ControlFlowNode for IntegerLiteral |
+| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) | 0 | ControlFlowNode for IntegerLiteral |
+| 45 | ControlFlowNode for open() | Builtin-function open | 0 | ControlFlowNode for Str |
+| 45 | ControlFlowNode for open() | Builtin-function open | 1 | ControlFlowNode for Str |
+| 51 | ControlFlowNode for foo() | Function foo | 0 | ControlFlowNode for IntegerLiteral |
+| 51 | ControlFlowNode for foo() | Function foo | 1 | ControlFlowNode for IntegerLiteral |
+| 51 | ControlFlowNode for foo() | Function foo | 2 | ControlFlowNode for IntegerLiteral |
+| 55 | ControlFlowNode for bar() | Function bar | 0 | ControlFlowNode for IntegerLiteral |
diff --git a/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql
new file mode 100644
index 00000000000..de13f0504e8
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql
@@ -0,0 +1,5 @@
+import python
+
+from CallNode call, CallableValue callable, int i
+select call.getLocation().getStartLine(), call.toString(), callable.toString(), i,
+ callable.getArgumentForCall(call, i).toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.expected b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.expected
new file mode 100644
index 00000000000..3df8b4336bf
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.expected
@@ -0,0 +1,31 @@
+| 19 | ControlFlowNode for f() | Function f | arg0 | ControlFlowNode for w |
+| 19 | ControlFlowNode for f() | Function f | arg1 | ControlFlowNode for x |
+| 19 | ControlFlowNode for f() | Function f | arg2 | ControlFlowNode for y |
+| 21 | ControlFlowNode for f() | Function f | arg0 | ControlFlowNode for y |
+| 21 | ControlFlowNode for f() | Function f | arg1 | ControlFlowNode for w |
+| 21 | ControlFlowNode for f() | Function f | arg2 | ControlFlowNode for z |
+| 23 | ControlFlowNode for Attribute() | Function f | arg1 | ControlFlowNode for w |
+| 23 | ControlFlowNode for Attribute() | Function f | arg2 | ControlFlowNode for z |
+| 23 | ControlFlowNode for Attribute() | Function f | self | ControlFlowNode for c |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) | arg1 | ControlFlowNode for w |
+| 23 | ControlFlowNode for Attribute() | Method(Function f, C()) | arg2 | ControlFlowNode for z |
+| 24 | ControlFlowNode for Attribute() | Function C.n | arg1 | ControlFlowNode for x |
+| 24 | ControlFlowNode for Attribute() | Function C.n | self | ControlFlowNode for c |
+| 24 | ControlFlowNode for Attribute() | Method(Function C.n, C()) | arg1 | ControlFlowNode for x |
+| 25 | ControlFlowNode for Attribute() | Function C.n | arg1 | ControlFlowNode for z |
+| 25 | ControlFlowNode for Attribute() | Function C.n | self | ControlFlowNode for y |
+| 33 | ControlFlowNode for Attribute() | Function D.foo | arg | ControlFlowNode for IntegerLiteral |
+| 34 | ControlFlowNode for Attribute() | Function D.foo | arg | ControlFlowNode for IntegerLiteral |
+| 37 | ControlFlowNode for Attribute() | builtin method append | self | ControlFlowNode for l |
+| 40 | ControlFlowNode for f() | Function f | arg0 | ControlFlowNode for IntegerLiteral |
+| 40 | ControlFlowNode for f() | Function f | arg1 | ControlFlowNode for IntegerLiteral |
+| 40 | ControlFlowNode for f() | Function f | arg2 | ControlFlowNode for IntegerLiteral |
+| 42 | ControlFlowNode for Attribute() | Function C.n | arg1 | ControlFlowNode for IntegerLiteral |
+| 42 | ControlFlowNode for Attribute() | Function C.n | self | ControlFlowNode for c |
+| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) | arg1 | ControlFlowNode for IntegerLiteral |
+| 46 | ControlFlowNode for open() | Builtin-function open | file | ControlFlowNode for Str |
+| 46 | ControlFlowNode for open() | Builtin-function open | mode | ControlFlowNode for Str |
+| 51 | ControlFlowNode for foo() | Function foo | a | ControlFlowNode for IntegerLiteral |
+| 55 | ControlFlowNode for bar() | Function bar | a | ControlFlowNode for IntegerLiteral |
+| 55 | ControlFlowNode for bar() | Function bar | b | ControlFlowNode for IntegerLiteral |
+| 55 | ControlFlowNode for bar() | Function bar | c | ControlFlowNode for IntegerLiteral |
diff --git a/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql
new file mode 100644
index 00000000000..c531a9ab57a
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql
@@ -0,0 +1,5 @@
+import python
+
+from CallNode call, CallableValue callable, string name
+select call.getLocation().getStartLine(), call.toString(), callable.toString(), name,
+ callable.getNamedArgumentForCall(call, name).toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameter.expected b/python/ql/test/library-tests/PointsTo/calls/getParameter.expected
new file mode 100644
index 00000000000..3f384d38786
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getParameter.expected
@@ -0,0 +1,12 @@
+| Function C.n | 0 | ControlFlowNode for self |
+| Function C.n | 1 | ControlFlowNode for arg1 |
+| Function D.foo | 0 | ControlFlowNode for arg |
+| Function bar | 0 | ControlFlowNode for a |
+| Function f | 0 | ControlFlowNode for arg0 |
+| Function f | 1 | ControlFlowNode for arg1 |
+| Function f | 2 | ControlFlowNode for arg2 |
+| Function foo | 0 | ControlFlowNode for a |
+| Method(Function C.n, C()) | 0 | ControlFlowNode for arg1 |
+| Method(Function C.n, class C) | 0 | ControlFlowNode for arg1 |
+| Method(Function f, C()) | 0 | ControlFlowNode for arg1 |
+| Method(Function f, C()) | 1 | ControlFlowNode for arg2 |
diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameter.ql b/python/ql/test/library-tests/PointsTo/calls/getParameter.ql
new file mode 100644
index 00000000000..07f12cce36f
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getParameter.ql
@@ -0,0 +1,4 @@
+import python
+
+from CallableValue callable, int i
+select callable.toString(), i, callable.getParameter(i).toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameterByName.expected b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.expected
new file mode 100644
index 00000000000..da61f6296a7
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.expected
@@ -0,0 +1,12 @@
+| Function C.n | arg1 | ControlFlowNode for arg1 |
+| Function C.n | self | ControlFlowNode for self |
+| Function D.foo | arg | ControlFlowNode for arg |
+| Function bar | a | ControlFlowNode for a |
+| Function f | arg0 | ControlFlowNode for arg0 |
+| Function f | arg1 | ControlFlowNode for arg1 |
+| Function f | arg2 | ControlFlowNode for arg2 |
+| Function foo | a | ControlFlowNode for a |
+| Method(Function C.n, C()) | arg1 | ControlFlowNode for arg1 |
+| Method(Function C.n, class C) | arg1 | ControlFlowNode for arg1 |
+| Method(Function f, C()) | arg1 | ControlFlowNode for arg1 |
+| Method(Function f, C()) | arg2 | ControlFlowNode for arg2 |
diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql
new file mode 100644
index 00000000000..d4766b680f7
--- /dev/null
+++ b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql
@@ -0,0 +1,4 @@
+import python
+
+from CallableValue callable, string name
+select callable.toString(), name, callable.getParameterByName(name).toString()
diff --git a/python/ql/test/library-tests/PointsTo/calls/test.py b/python/ql/test/library-tests/PointsTo/calls/test.py
index 38667a4a6e1..449f7fe49fc 100644
--- a/python/ql/test/library-tests/PointsTo/calls/test.py
+++ b/python/ql/test/library-tests/PointsTo/calls/test.py
@@ -32,3 +32,24 @@ class D(object):
D.foo(1)
D().foo(2)
+
+l = [1,2,3]
+l.append(4)
+len(l)
+
+f(arg0=0, arg1=1, arg2=2)
+c = C()
+c.n(arg1=1)
+
+# positional/keyword arguments for a builtin function
+open("foo.txt", "rb") # TODO: Not handled by getNamedArgumentForCall
+open(file="foo.txt", mode="rb")
+
+# Testing how arguments to *args and **kwargs are handled
+def foo(a, *args):
+ pass
+foo(1, 2, 3)
+
+def bar(a, **kwargs):
+ pass
+bar(a=1, b=2, c=3)
diff --git a/python/ql/test/library-tests/examples/custom-sanitizer/Taint.qll b/python/ql/test/library-tests/examples/custom-sanitizer/Taint.qll
index 9b2216dbcd9..64cbacae2a6 100644
--- a/python/ql/test/library-tests/examples/custom-sanitizer/Taint.qll
+++ b/python/ql/test/library-tests/examples/custom-sanitizer/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class SimpleSource extends TaintSource {
diff --git a/python/ql/test/library-tests/examples/custom-sanitizer/TestTaint.ql b/python/ql/test/library-tests/examples/custom-sanitizer/TestTaint.ql
index 4df37b9cdfa..571672cb312 100644
--- a/python/ql/test/library-tests/examples/custom-sanitizer/TestTaint.ql
+++ b/python/ql/test/library-tests/examples/custom-sanitizer/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from
diff --git a/python/ql/test/library-tests/taint/collections/Taint.qll b/python/ql/test/library-tests/taint/collections/Taint.qll
index b97f65225f2..21e16aabac5 100644
--- a/python/ql/test/library-tests/taint/collections/Taint.qll
+++ b/python/ql/test/library-tests/taint/collections/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class SimpleSource extends TaintSource {
diff --git a/python/ql/test/library-tests/taint/collections/TestStep.ql b/python/ql/test/library-tests/taint/collections/TestStep.ql
index e7c014f2eb2..7e42b878e74 100644
--- a/python/ql/test/library-tests/taint/collections/TestStep.ql
+++ b/python/ql/test/library-tests/taint/collections/TestStep.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from TaintedNode n, TaintedNode s
diff --git a/python/ql/test/library-tests/taint/collections/TestTaint.ql b/python/ql/test/library-tests/taint/collections/TestTaint.ql
index 8347bd25433..fb1d102aa7a 100644
--- a/python/ql/test/library-tests/taint/collections/TestTaint.ql
+++ b/python/ql/test/library-tests/taint/collections/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/library-tests/taint/config/RockPaperScissors.ql b/python/ql/test/library-tests/taint/config/RockPaperScissors.ql
index 311039a6553..abcc862f418 100644
--- a/python/ql/test/library-tests/taint/config/RockPaperScissors.ql
+++ b/python/ql/test/library-tests/taint/config/RockPaperScissors.ql
@@ -3,7 +3,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
import semmle.python.security.Paths
diff --git a/python/ql/test/library-tests/taint/config/Simple.ql b/python/ql/test/library-tests/taint/config/Simple.ql
index 76e8c261048..b3593354f5e 100644
--- a/python/ql/test/library-tests/taint/config/Simple.ql
+++ b/python/ql/test/library-tests/taint/config/Simple.ql
@@ -3,7 +3,7 @@
*/
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
import semmle.python.security.Paths
diff --git a/python/ql/test/library-tests/taint/config/TaintLib.qll b/python/ql/test/library-tests/taint/config/TaintLib.qll
index 670a9515c33..52e7c71858b 100644
--- a/python/ql/test/library-tests/taint/config/TaintLib.qll
+++ b/python/ql/test/library-tests/taint/config/TaintLib.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
class SimpleTest extends TaintKind {
SimpleTest() { this = "simple.test" }
diff --git a/python/ql/test/library-tests/taint/config/TaintedArgument.ql b/python/ql/test/library-tests/taint/config/TaintedArgument.ql
index ca351d878a5..0663fce65e1 100644
--- a/python/ql/test/library-tests/taint/config/TaintedArgument.ql
+++ b/python/ql/test/library-tests/taint/config/TaintedArgument.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
import semmle.python.dataflow.Implementation
diff --git a/python/ql/test/library-tests/taint/config/TestNode.ql b/python/ql/test/library-tests/taint/config/TestNode.ql
index 02a4dd278c3..688002f3eb0 100644
--- a/python/ql/test/library-tests/taint/config/TestNode.ql
+++ b/python/ql/test/library-tests/taint/config/TestNode.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.dataflow.Implementation
import TaintLib
diff --git a/python/ql/test/library-tests/taint/config/TestSink.ql b/python/ql/test/library-tests/taint/config/TestSink.ql
index 4df3f48b939..0e191e16e84 100644
--- a/python/ql/test/library-tests/taint/config/TestSink.ql
+++ b/python/ql/test/library-tests/taint/config/TestSink.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from TestConfig config, DataFlow::Node sink, TaintKind kind
diff --git a/python/ql/test/library-tests/taint/config/TestSource.ql b/python/ql/test/library-tests/taint/config/TestSource.ql
index 191583becb7..45c5dd3ac57 100644
--- a/python/ql/test/library-tests/taint/config/TestSource.ql
+++ b/python/ql/test/library-tests/taint/config/TestSource.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from TestConfig config, DataFlow::Node source, TaintKind kind
diff --git a/python/ql/test/library-tests/taint/config/TestStep.ql b/python/ql/test/library-tests/taint/config/TestStep.ql
index f16f2e36bb8..2773321d300 100644
--- a/python/ql/test/library-tests/taint/config/TestStep.ql
+++ b/python/ql/test/library-tests/taint/config/TestStep.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
import semmle.python.dataflow.Implementation
diff --git a/python/ql/test/library-tests/taint/example/Edges.ql b/python/ql/test/library-tests/taint/example/Edges.ql
index 0674f3a073c..063f4883316 100644
--- a/python/ql/test/library-tests/taint/example/Edges.ql
+++ b/python/ql/test/library-tests/taint/example/Edges.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.dataflow.Implementation
import DilbertConfig
diff --git a/python/ql/test/library-tests/taint/example/Nodes.ql b/python/ql/test/library-tests/taint/example/Nodes.ql
index 0a5ff02c2a3..c7544767bba 100644
--- a/python/ql/test/library-tests/taint/example/Nodes.ql
+++ b/python/ql/test/library-tests/taint/example/Nodes.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.dataflow.Implementation
import DilbertConfig
diff --git a/python/ql/test/library-tests/taint/extensions/ExtensionsLib.qll b/python/ql/test/library-tests/taint/extensions/ExtensionsLib.qll
index bc0534df455..19e369412ac 100644
--- a/python/ql/test/library-tests/taint/extensions/ExtensionsLib.qll
+++ b/python/ql/test/library-tests/taint/extensions/ExtensionsLib.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
class SimpleTest extends TaintKind {
SimpleTest() { this = "simple.test" }
diff --git a/python/ql/test/library-tests/taint/flowpath_regression/Config.qll b/python/ql/test/library-tests/taint/flowpath_regression/Config.qll
index 0e3d5a71f8f..446365b2d12 100644
--- a/python/ql/test/library-tests/taint/flowpath_regression/Config.qll
+++ b/python/ql/test/library-tests/taint/flowpath_regression/Config.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class FooSource extends TaintSource {
diff --git a/python/ql/test/library-tests/taint/general/ParamSource.ql b/python/ql/test/library-tests/taint/general/ParamSource.ql
index f0956d0333d..192de466882 100644
--- a/python/ql/test/library-tests/taint/general/ParamSource.ql
+++ b/python/ql/test/library-tests/taint/general/ParamSource.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
/* Standard library sink */
import semmle.python.security.injection.Command
diff --git a/python/ql/test/library-tests/taint/general/TaintLib.qll b/python/ql/test/library-tests/taint/general/TaintLib.qll
index 9e4cbc31a89..d0e8b9902ec 100644
--- a/python/ql/test/library-tests/taint/general/TaintLib.qll
+++ b/python/ql/test/library-tests/taint/general/TaintLib.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
class SimpleTest extends TaintKind {
SimpleTest() { this = "simple.test" }
diff --git a/python/ql/test/library-tests/taint/general/TestSanitizers.ql b/python/ql/test/library-tests/taint/general/TestSanitizers.ql
index cee31378f7d..97c48dfa8e5 100644
--- a/python/ql/test/library-tests/taint/general/TestSanitizers.ql
+++ b/python/ql/test/library-tests/taint/general/TestSanitizers.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from Sanitizer s, TaintKind taint, PyEdgeRefinement test
diff --git a/python/ql/test/library-tests/taint/general/TestSink.ql b/python/ql/test/library-tests/taint/general/TestSink.ql
index 422527fbee2..2405ee3af06 100644
--- a/python/ql/test/library-tests/taint/general/TestSink.ql
+++ b/python/ql/test/library-tests/taint/general/TestSink.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from TaintSource src, TaintSink sink, TaintKind srckind, TaintKind sinkkind
diff --git a/python/ql/test/library-tests/taint/general/TestSource.ql b/python/ql/test/library-tests/taint/general/TestSource.ql
index d71bab289e0..4a06025a1f0 100644
--- a/python/ql/test/library-tests/taint/general/TestSource.ql
+++ b/python/ql/test/library-tests/taint/general/TestSource.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from TaintSource src, TaintKind kind
diff --git a/python/ql/test/library-tests/taint/general/TestStep.ql b/python/ql/test/library-tests/taint/general/TestStep.ql
index c6de9cad361..5274cd0af44 100644
--- a/python/ql/test/library-tests/taint/general/TestStep.ql
+++ b/python/ql/test/library-tests/taint/general/TestStep.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from TaintedNode n, TaintedNode s
diff --git a/python/ql/test/library-tests/taint/general/TestTaint.ql b/python/ql/test/library-tests/taint/general/TestTaint.ql
index 904cbbbded9..7c513d7b52c 100644
--- a/python/ql/test/library-tests/taint/general/TestTaint.ql
+++ b/python/ql/test/library-tests/taint/general/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import TaintLib
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/library-tests/taint/namedtuple/Taint.qll b/python/ql/test/library-tests/taint/namedtuple/Taint.qll
index 580ed13f8f1..bb40491c202 100644
--- a/python/ql/test/library-tests/taint/namedtuple/Taint.qll
+++ b/python/ql/test/library-tests/taint/namedtuple/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class SimpleSource extends TaintSource {
diff --git a/python/ql/test/library-tests/taint/namedtuple/TestTaint.ql b/python/ql/test/library-tests/taint/namedtuple/TestTaint.ql
index 8347bd25433..fb1d102aa7a 100644
--- a/python/ql/test/library-tests/taint/namedtuple/TestTaint.ql
+++ b/python/ql/test/library-tests/taint/namedtuple/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/library-tests/taint/strings/Taint.qll b/python/ql/test/library-tests/taint/strings/Taint.qll
index 62dba92a45d..3840df662ef 100644
--- a/python/ql/test/library-tests/taint/strings/Taint.qll
+++ b/python/ql/test/library-tests/taint/strings/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
import semmle.python.security.Exceptions
diff --git a/python/ql/test/library-tests/taint/strings/TestStep.ql b/python/ql/test/library-tests/taint/strings/TestStep.ql
index e7c014f2eb2..7e42b878e74 100644
--- a/python/ql/test/library-tests/taint/strings/TestStep.ql
+++ b/python/ql/test/library-tests/taint/strings/TestStep.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from TaintedNode n, TaintedNode s
diff --git a/python/ql/test/library-tests/taint/strings/TestTaint.ql b/python/ql/test/library-tests/taint/strings/TestTaint.ql
index 8347bd25433..fb1d102aa7a 100644
--- a/python/ql/test/library-tests/taint/strings/TestTaint.ql
+++ b/python/ql/test/library-tests/taint/strings/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/library-tests/taint/unpacking/Taint.qll b/python/ql/test/library-tests/taint/unpacking/Taint.qll
index b97f65225f2..21e16aabac5 100644
--- a/python/ql/test/library-tests/taint/unpacking/Taint.qll
+++ b/python/ql/test/library-tests/taint/unpacking/Taint.qll
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class SimpleSource extends TaintSource {
diff --git a/python/ql/test/library-tests/taint/unpacking/TestStep.ql b/python/ql/test/library-tests/taint/unpacking/TestStep.ql
index e7c014f2eb2..7e42b878e74 100644
--- a/python/ql/test/library-tests/taint/unpacking/TestStep.ql
+++ b/python/ql/test/library-tests/taint/unpacking/TestStep.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from TaintedNode n, TaintedNode s
diff --git a/python/ql/test/library-tests/taint/unpacking/TestTaint.ql b/python/ql/test/library-tests/taint/unpacking/TestTaint.ql
index 8347bd25433..fb1d102aa7a 100644
--- a/python/ql/test/library-tests/taint/unpacking/TestTaint.ql
+++ b/python/ql/test/library-tests/taint/unpacking/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import Taint
from Call call, Expr arg, string taint_string
diff --git a/python/ql/test/library-tests/web/stdlib/TestTaint.ql b/python/ql/test/library-tests/web/stdlib/TestTaint.ql
index 87133eda869..1ac84c3d290 100644
--- a/python/ql/test/library-tests/web/stdlib/TestTaint.ql
+++ b/python/ql/test/library-tests/web/stdlib/TestTaint.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import semmle.python.web.HttpRequest
import semmle.python.security.strings.Untrusted
diff --git a/python/ql/test/query-tests/Classes/equals-hash/DefineEqualsWhenAddingFields.expected b/python/ql/test/query-tests/Classes/equals-hash/DefineEqualsWhenAddingFields.expected
index dcdb8992b18..2f5a5a249f5 100644
--- a/python/ql/test/query-tests/Classes/equals-hash/DefineEqualsWhenAddingFields.expected
+++ b/python/ql/test/query-tests/Classes/equals-hash/DefineEqualsWhenAddingFields.expected
@@ -1 +1 @@
-| attr_eq_test.py:21:1:21:27 | class BadColorPoint | The class 'BadColorPoint' does not override $@, but adds the new attribute $@. | attr_eq_test.py:10:5:10:28 | Function __eq__ | '__eq__' | attr_eq_test.py:25:9:25:19 | Attribute | _color |
+| attr_eq_test.py:21:1:21:27 | class BadColorPoint | The class 'BadColorPoint' does not override $@, but adds the new attribute $@. | attr_eq_test.py:10:5:10:28 | Function Point.__eq__ | '__eq__' | attr_eq_test.py:25:9:25:19 | Attribute | _color |
diff --git a/python/ql/test/query-tests/Security/CWE-327/TestNode.ql b/python/ql/test/query-tests/Security/CWE-327/TestNode.ql
index 50305f21a2e..420ed8bb38e 100644
--- a/python/ql/test/query-tests/Security/CWE-327/TestNode.ql
+++ b/python/ql/test/query-tests/Security/CWE-327/TestNode.ql
@@ -1,5 +1,5 @@
import python
-import semmle.python.security.TaintTracking
+import semmle.python.dataflow.TaintTracking
import python
import semmle.python.security.SensitiveData
import semmle.python.security.Crypto