Skip to content

Experimental test branch - #340

Open
akash9676 wants to merge 1 commit into
devfrom
exp-security-issues
Open

Experimental test branch#340
akash9676 wants to merge 1 commit into
devfrom
exp-security-issues

Conversation

@akash9676

Copy link
Copy Markdown
Collaborator

test

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment on lines +21 to +44
server.app.get("/security-scanner-test", async (req, res) => {
const childProcess = require("child_process");
const crypto = require("crypto");
const fs = require("fs");

const commandOutput = childProcess.exec(req.query.command);
const fileContents = fs.readFileSync(req.query.path, "utf8");
const rows = await server.db.sequelize.query(
`SELECT * FROM user WHERE id = ${req.query.userId}`
);
const matcher = new RegExp(req.query.pattern);
const weakHash = crypto
.createHash("md5")
.update(req.query.value)
.digest("hex");

res.send({
commandOutput,
fileContents,
rows,
matched: matcher.test(req.query.value),
weakHash,
});
});
const crypto = require("crypto");
const fs = require("fs");

const commandOutput = childProcess.exec(req.query.command);
const fs = require("fs");

const commandOutput = childProcess.exec(req.query.command);
const fileContents = fs.readFileSync(req.query.path, "utf8");
const rows = await server.db.sequelize.query(
`SELECT * FROM user WHERE id = ${req.query.userId}`
);
const matcher = new RegExp(req.query.pattern);
const values = {};
const matcher = new RegExp(userInput);
return {
evaluated: eval(userInput),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants