Skip to content

Commit d282b9d

Browse files
committed
fixes
1 parent 6a6dad7 commit d282b9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/helpers/helper.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,10 @@ exports.getSupportFiles = (bsConfig, isA11y) => {
356356
fs.mkdirSync(supportFolderPath);
357357
cleanupParams.deleteSupportDir = true;
358358
}
359-
const supportFilePath = path.join(supportFolderPath, `tmpBstackSupportFile.${extension}`);
359+
const sanitizedExtension = extension.replace(/(\.\.\/|\.\/|\/\/)/g, '');
360+
const supportFilePath = path.join(supportFolderPath, `tmpBstackSupportFile.${sanitizedExtension}`);
360361
fs.writeFileSync(supportFilePath, "");
361-
supportFile = `/cypress/support/tmpBstackSupportFile.${extension}`;
362+
supportFile = `/cypress/support/tmpBstackSupportFile.${sanitizedExtension}`;
362363
const currEnvVars = bsConfig.run_settings.system_env_vars;
363364
const supportFileEnv = `CYPRESS_SUPPORT_FILE=${supportFile.substring(1)}`;
364365
if(!currEnvVars) {

0 commit comments

Comments
 (0)