Skip to content

Commit 495f744

Browse files
committed
Swift: Attempt to address qhelp suggestions.
1 parent 05d9c7b commit 495f744

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<overview>
66

77
<p>
8-
If a database query (such as a SQL query) is built from user-provided data without sufficient sanitization, a user may be able to run malicious database queries.
8+
If a database query (such as a SQL query) is built from user-provided data without sufficient sanitization, a user may be able to run malicious database queries. An attacker can craft the part of the query they control to change the overall meaning of the query.
99
</p>
1010

1111
</overview>
1212
<recommendation>
1313

1414
<p>
15-
Most database connector libraries offer a way of safely embedding untrusted data into a query by means of query parameters or prepared statements. Use these features rather than building queries by string concatenation.
15+
Most database connector libraries offer a way of safely embedding untrusted data into a query by means of query parameters or prepared statements. Use these features rather than building queries by string concatenation or similar methods without sufficient sanitization.
1616
</p>
1717

1818
</recommendation>
@@ -23,7 +23,7 @@ Most database connector libraries offer a way of safely embedding untrusted data
2323

2424
<sample src="SqlInjectionBad.swift" />
2525

26-
<p>A better way to do this is with a prepared statement, binding <code>userControlledString</code> to a parameter of that statement. An attacker who controls the contents of that parameter cannot 'break out' and change the overall meaning of the SQL query.
26+
<p>A better way to do this is with a prepared statement, binding <code>userControlledString</code> to a parameter of that statement. An attacker who controls the contents of that parameter cannot change the overall meaning of the query.
2727
</p>
2828

2929
<sample src="SqlInjectionGood.swift" />

0 commit comments

Comments
 (0)