Skip to content

Commit 24c6bb4

Browse files
committed
Swift: More modern (?) phrasing.
1 parent 3da3a27 commit 24c6bb4

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

swift/ql/src/queries/Security/CWE-089/SqlInjection.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name SQL query built from user-controlled sources
3-
* @description Building a SQL query from user-controlled sources is vulnerable to insertion of malicious SQL code by the user.
2+
* @name Database query built from user-controlled sources
3+
* @description Building a database query from user-controlled sources is vulnerable to insertion of malicious code by the user.
44
* @kind path-problem
55
* @problem.severity error
66
* @security-severity 8.8
@@ -79,5 +79,5 @@ class SqlInjectionConfig extends TaintTracking::Configuration {
7979

8080
from SqlInjectionConfig config, DataFlow::PathNode sourceNode, DataFlow::PathNode sinkNode
8181
where config.hasFlowPath(sourceNode, sinkNode)
82-
select sinkNode.getNode(), sourceNode, sinkNode, "This SQL query depends on $@.",
82+
select sinkNode.getNode(), sourceNode, sinkNode, "This query depends on $@.",
8383
sourceNode.getNode(), "a user-provided value"

swift/ql/test/query-tests/Security/CWE-089/SqlInjection.expected

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ nodes
3333
| SQLite.swift:132:16:132:16 | remoteString | semmle.label | remoteString |
3434
subpaths
3535
#select
36-
| SQLite.swift:73:17:73:17 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:73:17:73:17 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
37-
| SQLite.swift:74:17:74:17 | unsafeQuery2 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:74:17:74:17 | unsafeQuery2 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
38-
| SQLite.swift:75:17:75:17 | unsafeQuery3 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:75:17:75:17 | unsafeQuery3 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
39-
| SQLite.swift:83:29:83:29 | unsafeQuery3 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:83:29:83:29 | unsafeQuery3 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
40-
| SQLite.swift:95:28:95:28 | remoteString | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:95:28:95:28 | remoteString | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
41-
| SQLite.swift:100:29:100:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:100:29:100:29 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
42-
| SQLite.swift:103:29:103:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:103:29:103:29 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
43-
| SQLite.swift:106:29:106:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:106:29:106:29 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
44-
| SQLite.swift:109:9:109:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:109:9:109:9 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
45-
| SQLite.swift:111:9:111:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:111:9:111:9 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
46-
| SQLite.swift:113:9:113:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:113:9:113:9 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
47-
| SQLite.swift:115:12:115:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:115:12:115:12 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
48-
| SQLite.swift:117:12:117:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:117:12:117:12 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
49-
| SQLite.swift:119:12:119:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:119:12:119:12 | unsafeQuery1 | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
50-
| SQLite.swift:132:16:132:16 | remoteString | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:132:16:132:16 | remoteString | This SQL query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
36+
| SQLite.swift:73:17:73:17 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:73:17:73:17 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
37+
| SQLite.swift:74:17:74:17 | unsafeQuery2 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:74:17:74:17 | unsafeQuery2 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
38+
| SQLite.swift:75:17:75:17 | unsafeQuery3 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:75:17:75:17 | unsafeQuery3 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
39+
| SQLite.swift:83:29:83:29 | unsafeQuery3 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:83:29:83:29 | unsafeQuery3 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
40+
| SQLite.swift:95:28:95:28 | remoteString | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:95:28:95:28 | remoteString | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
41+
| SQLite.swift:100:29:100:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:100:29:100:29 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
42+
| SQLite.swift:103:29:103:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:103:29:103:29 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
43+
| SQLite.swift:106:29:106:29 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:106:29:106:29 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
44+
| SQLite.swift:109:9:109:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:109:9:109:9 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
45+
| SQLite.swift:111:9:111:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:111:9:111:9 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
46+
| SQLite.swift:113:9:113:9 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:113:9:113:9 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
47+
| SQLite.swift:115:12:115:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:115:12:115:12 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
48+
| SQLite.swift:117:12:117:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:117:12:117:12 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
49+
| SQLite.swift:119:12:119:12 | unsafeQuery1 | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:119:12:119:12 | unsafeQuery1 | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |
50+
| SQLite.swift:132:16:132:16 | remoteString | SQLite.swift:62:26:62:80 | call to init(contentsOf:) : | SQLite.swift:132:16:132:16 | remoteString | This query depends on $@. | SQLite.swift:62:26:62:80 | call to init(contentsOf:) | a user-provided value |

0 commit comments

Comments
 (0)