mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
[pitboss] phase 21: Track M.3 — ScheduledJob + GraphQLResolver + WebSocket + Middleware + Migration
This commit is contained in:
parent
00b0fbaea9
commit
f9bd51c024
84 changed files with 5898 additions and 40 deletions
17
tests/dynamic_fixtures/middleware/express/vuln.js
Normal file
17
tests/dynamic_fixtures/middleware/express/vuln.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Phase 21 (Track M.3) — Express middleware vuln fixture.
|
||||
//
|
||||
// `audit(req, res, next)` is mounted via `app.use(audit)`. It splices
|
||||
// the request body into a shell command via `execSync`.
|
||||
const _NYX_ADAPTER_MARKER = "require('express')";
|
||||
const _NYX_REGISTER_MARKER = "app.use(audit)";
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
function audit(req, res, next) {
|
||||
// SINK: tainted req.body concatenated into shell command.
|
||||
const out = execSync('echo ' + String(req.body || '')).toString();
|
||||
if (typeof next === 'function') next();
|
||||
return out;
|
||||
}
|
||||
|
||||
module.exports = { audit };
|
||||
Loading…
Add table
Add a link
Reference in a new issue