Skip to content

Commit

Permalink
Log error message if file name does not pass whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Aug 8, 2018
1 parent 7814826 commit c1ef946
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/react-dev-utils/launchEditor.js
Expand Up @@ -321,6 +321,18 @@ function launchEditor(fileName, lineNumber, colNumber) {
process.platform === 'win32' &&
!WINDOWS_FILE_NAME_WHITELIST.test(fileName.trim())
) {
console.log();
console.log(
chalk.red('Could not open ' + path.basename(fileName) + ' in the editor.')
);
console.log();
console.log(
'When running on Windows, file names are checked against a whitelist ' +
'to protect against remote code execution attacks. File names may ' +
'consist only of alphanumeric characters (all languages), periods, ' +
'dashes, slashes, and underscores.'
);
console.log();
return;
}

Expand Down

0 comments on commit c1ef946

Please sign in to comment.