-
-
Notifications
You must be signed in to change notification settings - Fork 7k
fix(dev): denied requests overly #20410
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
Conversation
/ecosystem-ci run |
commit: |
I'm just an outside observer and not intimitely familar with all the specifics here so maybe I'm missing something, but I still seriously question why there should be any mention of The only reason this seems to be here is because the SVG handler further down isn't properly checking the requested path before reading the file on disk. So again, either this is a generic path security problem that should be fixed in a generic way and shouldn't have any mention of SVGs, or it's a specific problem with the SVG handler and it should be fixed there. |
This comment was marked as outdated.
This comment was marked as outdated.
There are two options. One is stopping denied files from ever entering the pipeline, and the other one is as you say, give the responsibility to every plugin that loads from the file system to do the check. The idea with adding the check before entering the pipeline was that it would make plugins more secure. The check
This was also added in response to CVEs, so minimal changes were applied because we needed to release them in patches. I don't know now if the long term plan to remove the condition is feasible because there are virtual plugins that don't properly mark their ids with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes make sense to me. Nice to see some cleanups too.
📝 Ran ecosystem CI on
✅ nuxt, laravel, astro, analogjs, qwik, vite-plugin-pwa, unocss, quasar, marko, react-router, vite-plugin-cloudflare, vite-setup-catalogue, sveltekit, vite-plugin-vue, storybook, rakkas, waku, vite-environment-examples, vitepress, ladle, vite-plugin-svelte, vuepress, vitest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to wait for a minor for this one?
Description
This line was not matching.
vite/packages/vite/src/node/server/middlewares/static.ts
Line 281 in 6bc8bf6
checkServingAccess
tocheckLoadingAccess
fordeniedServingAccessForTransform
as this function receives a path instead of an URL (this leads to requests denied more than needed. this does not lead to requests allowed more than needed)isFileLoadingAllowed
(this isn't needed for the fix, but included as it's related to the change in 9df604b)fixes #19795
fixes #20408
refs #20144