Skip to content

Commit 2768343

Browse files
fix(security): remove shell:true from spawn in runCypressTestsLocally [APS-19013]
INJ-004: drop shell:true from the spawn options in helper.js runCypressTestsLocally. spawn passes argv directly to npx so the shell is not needed. Eliminates shell-injection via metacharacters in --spec / other rawArgs reaching the local Cypress runner (CWE-78).
1 parent d9e52e8 commit 2768343

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/testObservability/helper/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ exports.runCypressTestsLocally = (bsConfig, args, rawArgs) => {
930930
const cypressProcess = spawn(
931931
'npx',
932932
['cypress', 'run', ...getReRunSpecs(rawArgs.slice(1)), ...getLocalSessionReporter()],
933-
{ stdio: 'inherit', cwd: process.cwd(), env: process.env, shell: true }
933+
{ stdio: 'inherit', cwd: process.cwd(), env: process.env }
934934
);
935935
cypressProcess.on('close', async (code) => {
936936
logger.info(`Cypress process exited with code ${code}`);

0 commit comments

Comments
 (0)