mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-01 06:29:47 +00:00
Don't run the spawned program in a shell.
Instead, run it directly. This avoids false positives when running non-bash commands and false negatives when trying to run a shell.
This commit is contained in:
parent
f82288f373
commit
bf431cf222
@ -14,8 +14,8 @@ router.get('/', function(req, res) {
|
||||
});
|
||||
|
||||
router.get('/exec/:cmd', function(req, res) {
|
||||
var output = child_process.execSync(req.params.cmd);
|
||||
res.send(output);
|
||||
var ret = child_process.spawnSync(req.params.cmd);
|
||||
res.send(ret.stdout);
|
||||
});
|
||||
|
||||
app.use('/api', router);
|
||||
|
Loading…
Reference in New Issue
Block a user