Skip to content

Commit fb9ffce

Browse files
test(regression): drop shell:true in percy-cli helper to clear Semgrep OSS alert
The nosemgrep comment suppressed spawn-shell-true for the workflow exit code, but GitHub code-scanning (Semgrep OSS) still surfaced the suppressed finding as an alert and failed the check. Eliminate it instead: npx resolves via PATH without a shell (this suite is Linux-only) and args are passed as an array, so shell:true was unnecessary and there is no command-injection surface. PER-8250
1 parent f054912 commit fb9ffce

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

test/regression/lib/percy-cli.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import { spawn } from 'child_process';
77
export function runPercy(args, { env = {}, cwd } = {}) {
88
return new Promise((resolve, reject) => {
99
let output = '';
10-
// shell:true lets `npx` resolve cross-platform (matches regression.test.js).
11-
// Args are static and test-controlled — no untrusted input — so there is no
12-
// command-injection surface here.
13-
// nosemgrep: javascript.lang.security.audit.spawn-shell-true.spawn-shell-true
10+
// No shell:true — `npx` resolves via PATH directly (this regression suite is
11+
// Linux-only), and args are passed as an array, so there is no shell parsing
12+
// or command-injection surface.
1413
const child = spawn('npx', ['percy', ...args], {
1514
env: { ...process.env, ...env },
1615
cwd,
17-
stdio: ['ignore', 'pipe', 'pipe'],
18-
shell: true
16+
stdio: ['ignore', 'pipe', 'pipe']
1917
});
2018

2119
const onData = data => {

0 commit comments

Comments
 (0)