Skip to content

Commit bdfc5bd

Browse files
committed
Add FP cases that are left out in the previous commit.
1 parent fb979d2 commit bdfc5bd

File tree

1 file changed

+13
-0
lines changed
  • javascript/frameworks/cap/test/queries/cqlinjection/srv

1 file changed

+13
-0
lines changed

javascript/frameworks/cap/test/queries/cqlinjection/srv/service1.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,5 +769,18 @@ module.exports = class Service1 extends cds.ApplicationService {
769769
const { id } = req.data;
770770
cds.db.delete("Entity1").where`ID = ${id}`; // FP
771771
});
772+
773+
/* ========== FP cases that don't involve CAP APIs ========== */
774+
775+
const pg = require("pg");
776+
let pool = new pg.Pool(config);
777+
pool.query(req.params.category, [], function (err, results) { // non-CQL injection alert
778+
});
779+
780+
const app = require("express")();
781+
app.get("search", function handler(req2, res) {
782+
pool.query(req2.params.category, [], function (err, results) { // non-CQL injection alert
783+
});
784+
});
772785
}
773786
};

0 commit comments

Comments
 (0)