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 #31

Open
Xiqinger opened this issue Mar 15, 2024 · 1 comment
Open

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

Xiqinger opened this issue Mar 15, 2024 · 1 comment

Comments

@Xiqinger
Copy link

Lack proper validation for uploaded image files in the backend.
While there is validation in the frontend component "img-box.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.

It is recommended to implement server-side validation for uploaded image files, in ServerResponseEntity<OssVO> com.mall4j.cloud.biz.controller.OssController.uploadFile(@RequestParam(value="file") MultipartFile file) throws IOException. 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

@WangH26
Copy link

WangH26 commented Mar 15, 2024 via email

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

2 participants