Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from zpbrent/patch-3
Browse files Browse the repository at this point in the history
Command Injection vul fix: Replace execSync with execFileSync
  • Loading branch information
huntr.dev | the place to protect open source authored Mar 3, 2021
2 parents 22f46a8 + 7c9e253 commit ab46fb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-dev-utils/getProcessForPort.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

var chalk = require('chalk');
var execSync = require('child_process').execSync;
var execFileSync = require('child_process').execFileSync;
var path = require('path');

var execOptions = {
Expand All @@ -25,7 +26,7 @@ function isProcessAReactApp(processCommand) {
}

function getProcessIdOnPort(port) {
return execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions)
return execFileSync('lsof', ['-i:'+port, '-P', '-t', '-sTCP:LISTEN'], execOptions)
.split('\n')[0]
.trim();
}
Expand Down

0 comments on commit ab46fb8

Please sign in to comment.