Skip to content

TEST PR : DO NOT MERGE#14532

Draft
v-rusraut wants to merge 3 commits into
masterfrom
v-rusraut/codeqltest
Draft

TEST PR : DO NOT MERGE#14532
v-rusraut wants to merge 3 commits into
masterfrom
v-rusraut/codeqltest

Conversation

@v-rusraut

Copy link
Copy Markdown
Contributor

Required items, please complete

Change(s):

  • See guidance below

Reason for Change(s):

  • See guidance below

Version Updated:

  • Required only for Detections/Analytic Rule templates
  • See guidance below

Testing Completed:

  • See guidance below

@v-rusraut v-rusraut requested review from a team as code owners June 22, 2026 10:53
@v-atulyadav v-atulyadav self-assigned this Jun 22, 2026
@v-atulyadav v-atulyadav marked this pull request as draft June 22, 2026 11:22
Comment thread Test.js
Comment on lines +14 to +24
app.get("/user", (req, res) => {
const id = req.query.id;
const query = "SELECT * FROM users WHERE id = '" + id + "'"; // CWE-89: SQL Injection
connection.query(query, (err, results) => {
if (err) {
res.status(500).send("Error");
return;
}
res.json(results);
});
});
Comment thread Test.js
app.get("/user", (req, res) => {
const id = req.query.id;
const query = "SELECT * FROM users WHERE id = '" + id + "'"; // CWE-89: SQL Injection
connection.query(query, (err, results) => {
Comment thread Test.js
Comment on lines +26 to +33
app.get("/exec", (req, res) => {
const { exec } = require("child_process");
const cmd = req.query.cmd;
exec("ping " + cmd, (err, stdout) => {
// CWE-78: OS Command Injection
res.send(stdout);
});
});
Comment thread Test.js
app.get("/exec", (req, res) => {
const { exec } = require("child_process");
const cmd = req.query.cmd;
exec("ping " + cmd, (err, stdout) => {
Comment thread Test.js
Comment on lines +35 to +42
app.get("/file", (req, res) => {
const fs = require("fs");
const filePath = req.query.path;
fs.readFile(filePath, "utf8", (err, data) => {
// CWE-22: Path Traversal
res.send(data);
});
});
Comment thread Test.js
app.get("/file", (req, res) => {
const fs = require("fs");
const filePath = req.query.path;
fs.readFile(filePath, "utf8", (err, data) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants