From c1ef9468f68af7ac236b2b3b0faf059cdf0b0fcb Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 8 Aug 2018 14:19:01 -0700 Subject: [PATCH] Log error message if file name does not pass whitelist --- packages/react-dev-utils/launchEditor.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/react-dev-utils/launchEditor.js b/packages/react-dev-utils/launchEditor.js index 25413b50a85..dc7b63345eb 100644 --- a/packages/react-dev-utils/launchEditor.js +++ b/packages/react-dev-utils/launchEditor.js @@ -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; }