Skip to content

Commit 9aeba4f

Browse files
committed
changes based on review
1 parent 1e08105 commit 9aeba4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

javascript/ql/src/Security/CWE-089/SqlInjection.inc.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ an HTTP request handler in a web application, whose parameter
4040
<p>
4141
The handler constructs constructs an SQL query string from user input
4242
and executes it as a database query using the <code>pg</code> library.
43-
THe user input may contain quote characters, so this code is vulnerable
43+
The user input may contain quote characters, so this code is vulnerable
4444
to a SQL injection attack.
4545
</p>
4646

javascript/ql/src/Security/CWE-089/examples/SqlInjectionFix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const app = require("express")(),
55
app.get("search", function handler(req, res) {
66
// GOOD: use parameters
77
var query2 =
8-
"SELECT ITEM,PRICE FROM PRODUCT WHERE ITEM_CATEGORY=$1" + " ORDER BY PRICE";
8+
"SELECT ITEM,PRICE FROM PRODUCT WHERE ITEM_CATEGORY=$1 ORDER BY PRICE";
99
pool.query(query2, [req.params.category], function(err, results) {
1010
// process results
1111
});

0 commit comments

Comments
 (0)