Vite's `server.fs.deny` is bypassed when using `?import&raw`
Package
Affected versions
>= 5.4.0, <= 5.4.5
>= 5.3.0, <= 5.3.5
>= 4.0.0, <= 4.5.3
<= 3.2.10
>= 5.2.0, < 5.2.14
>= 5.0.0, <= 5.1.7
Patched versions
5.4.6
5.3.6
4.5.4
3.2.11
5.2.14
5.1.8
Description
Published to the GitHub Advisory Database
Sep 17, 2024
Reviewed
Sep 17, 2024
Published by the National Vulnerability Database
Sep 17, 2024
Last updated
Sep 19, 2024
Summary
The contents of arbitrary files can be returned to the browser.
Details
@fs
denies access to files outside of Vite serving allow list. Adding?import&raw
to the URL bypasses this limitation and returns the file content if it exists.PoC
References