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

Commit ab46fb8

Browse files
author
huntr.dev | the place to protect open source
authored
Merge pull request #2 from zpbrent/patch-3
Command Injection vul fix: Replace execSync with execFileSync
2 parents 22f46a8 + 7c9e253 commit ab46fb8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-dev-utils/getProcessForPort.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
var chalk = require('chalk');
1111
var execSync = require('child_process').execSync;
12+
var execFileSync = require('child_process').execFileSync;
1213
var path = require('path');
1314

1415
var execOptions = {
@@ -25,7 +26,7 @@ function isProcessAReactApp(processCommand) {
2526
}
2627

2728
function getProcessIdOnPort(port) {
28-
return execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions)
29+
return execFileSync('lsof', ['-i:'+port, '-P', '-t', '-sTCP:LISTEN'], execOptions)
2930
.split('\n')[0]
3031
.trim();
3132
}

0 commit comments

Comments
 (0)