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

Lack of Backend Validation for Uploaded Image Size and Type #22

Open
Xiqinger opened this issue Mar 15, 2024 · 0 comments
Open

Lack of Backend Validation for Uploaded Image Size and Type #22

Xiqinger opened this issue Mar 15, 2024 · 0 comments

Comments

@Xiqinger
Copy link

Lack proper validation for uploaded image files in the backend.
While there is validation in the frontend component "index.vue," it is crucial to perform server-side validation as well. This vulnerability allows attackers to upload files of any type and size, potentially leading to XSS attacks or resource exhaustion, which can result in DDoS attacks.

Two interfaces are affected:

    1. "/upload/element" com.yami.shop.admin.controller.FileController.uploadElementFile
    1. "/upload/element" com.yami.shop.admin.controller.FileController.uploadTinymceEditorImages

It is recommended to implement server-side validation for uploaded image files in String com.yami.shop.service.impl.AttachFileServiceImpl.uploadFile(MultipartFile file) . This includes checking the file size and verifying that the file type is allowed (e.g., image/jpeg, image/png). By implementing these validations in the backend, you can prevent the upload of malicious files, mitigate the risk of XSS attacks, and prevent resource consumption that could lead to DDoS attacks.
image

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

No branches or pull requests

1 participant