Skip to content

Commit 5cbe985

Browse files
committed
fixup! fix(ng-dev): prevent OS command injection in ChildProcess wrappers
1 parent 2462a4c commit 5cbe985

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

ng-dev/utils/child-process.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export interface SpawnSyncOptions
3737
export interface SpawnOptions extends CommonCmdOpts, Omit<_SpawnOptions, 'stdio'> {}
3838

3939
/** Interface describing the options for exec-ing a process. */
40-
export interface ExecOptions extends CommonCmdOpts, Omit<_ExecOptions, 'shell' | 'stdio'> {}
40+
export interface ExecOptions extends CommonCmdOpts, Omit<_ExecOptions, 'stdio'> {}
4141

4242
/** Interface describing the options for spawning an interactive process. */
43-
export interface SpawnInteractiveCommandOptions extends Omit<_SpawnOptions, 'shell' | 'stdio'> {}
43+
export interface SpawnInteractiveCommandOptions extends Omit<_SpawnOptions, 'stdio'> {}
4444

4545
/** Interface describing the result of a spawned process. */
4646
export interface SpawnResult {
@@ -71,7 +71,7 @@ export abstract class ChildProcess {
7171
return new Promise<void>((resolve, reject) => {
7272
const commandText = `${command} ${args.join(' ')}`;
7373
Log.debug(`Executing command: ${commandText}`);
74-
const childProcess = _spawn(command, args, {...options, shell: true, stdio: 'inherit'});
74+
const childProcess = _spawn(command, args, {...options, stdio: 'inherit'});
7575
// The `close` event is used because the process is guaranteed to have completed writing to
7676
// stdout and stderr, using the `exit` event can cause inconsistent information in stdout and
7777
// stderr due to a race condition around exiting.

0 commit comments

Comments
 (0)