mirror of
https://github.com/SquidSec/SquidGate
synced 2026-08-09 12:22:48 +00:00
Demo only — hardcoded secret + injection / dangerous API patterns. See examples/README.md Co-authored-by: SquidSec Bot <bot@squidsec.local>
15 lines
370 B
JavaScript
15 lines
370 B
JavaScript
// SquidGate sample — JavaScript (intentional vulnerabilities for demo)
|
|
const API_KEY = "sk-live-js-demo-NOT-A-REAL-KEY-12345";
|
|
|
|
function getUser(id) {
|
|
// SQL injection via string concat
|
|
const q = "SELECT * FROM users WHERE id = " + id;
|
|
return db.query(q);
|
|
}
|
|
|
|
function run(code) {
|
|
return eval(code); // dangerous
|
|
}
|
|
|
|
module.exports = { getUser, run, API_KEY };
|