Skip to content
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

[vulnerability] Vite serves files ignoring fs.allow setting #5345

Closed
7 tasks done
benmccann opened this issue Oct 19, 2021 · 0 comments · Fixed by #5361
Closed
7 tasks done

[vulnerability] Vite serves files ignoring fs.allow setting #5345

benmccann opened this issue Oct 19, 2021 · 0 comments · Fixed by #5361

Comments

@benmccann
Copy link
Collaborator

Describe the bug

Vite appears to be serving files from the root directory regardless of how fs.allow is set. This would allow other users on the network to potentially steal .env files or other sensitive data in dev mode

I think the bug is on this line:

middlewares.use(serveStaticMiddleware(root, config))

At least for SvelteKit apps, there is no reason to serve anything outside of static, but we can't restrict the serving to that directory

Normally I wouldn't report a security vulnerability publicly, but this was already reported as sveltejs/kit#2627

Reproduction

npm init svelte@next sveltekit
cd sveltekit
npm run dev

Load http://localhost:3000/svelte.config.js in the browser

System Info

Vite 2.6.10

Used Package Manager

npm

Logs

No response

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant