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

allowed_file uploading bypass by simply changing file extension #112

Open
nevercodecorrect opened this issue Dec 20, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@nevercodecorrect
Copy link

Hi,
When I try the product, I find that it is easy to bypass the file type restriction on the uploading functionality. The issue is CWE-646: Reliance on File Name or Extension of Externally-Supplied File

You could rename any file with the extension types presented in here to bypass the limitation. Only checking extension suffix in the filename is not enough, using magic number to check would be a better approach.

Thanks for your time reading.

@Timothyxxx Timothyxxx added the enhancement New feature or request label Dec 22, 2023
@Timothyxxx
Copy link
Contributor

Thanks for pointing that out, we will try to fix this part in the future.

@BlankCheng
Copy link
Contributor

Thanks for your advice. This is indeed vulnerable. Would you like to open a PR to improve it? We'll be glad to have more contributors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants