UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

25 lines (20 loc) 536 B
var express = require('express'); var app = express(); var myObj = {} app.get('/test1', function(req, res) { var prop = req.query.userControlled // ruleid: remote-property-injection myObj[prop] = function() {} res.send('ok') }) app.get('/test2', function(req, res) { // ruleid: remote-property-injection myObj[req.body] = foobar() res.send('ok') }) app.get('/okTest', function(req, res) { var prop = "$" + req.query.userControlled // ok: remote-property-injection myObj[prop] = function() {} res.send('ok') })