-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add filename validation for windows #50
Comments
These are basically backports of facebook/create-react-app#4866 and facebook/create-react-app#5431 The only remaining problem is that this RegExp can't be parsed with our current ESLint setup. Footnotes |
@sodatea your fix for this broke svelte-inspector for sveltekit +page files: sveltejs/vite-plugin-svelte#943 (comment) is + an exploitable char in windows filenames? |
After reading https://stackoverflow.com/q/4094699/2302258, I believe it's not exploitable. |
expanding the safe chars list or switching to only blocking bad chars both seem fine to me too, but if there is a way to properly escape the path before sending it to cmd thats even better |
this should be re-opened. we're still getting issues on Win11 Reference |
The vue-inspector by @webfansplz contains code that prevents some filenames from being opened with a shell command
https://github.com/webfansplz/vite-plugin-vue-inspector/blob/main/src/launch-editor.ts#L336-L357
This is to prevent possible attacks where a crafted filename could be used to execute malicious commands.
Currently launch-editor does not have a check like this. It's hard to exploit because there is an
fs.existsSync
check but for defense in depth it would be better to not let these kinds of filenames throughThe regex here https://github.com/webfansplz/vite-plugin-vue-inspector/blob/main/src/launch-editor.ts#L108-L112 looks longish, maybe a smaller list of forbidden chars does the trick too
The text was updated successfully, but these errors were encountered: