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

There is arbitrary file upload vulnerability #57

Closed
qytxhjb opened this issue Mar 7, 2023 · 2 comments
Closed

There is arbitrary file upload vulnerability #57

qytxhjb opened this issue Mar 7, 2023 · 2 comments

Comments

@qytxhjb
Copy link

qytxhjb commented Mar 7, 2023

Only the suffix name of the uploaded file is verified here. Users can forge the requested data body and upload any file, which has potential risks to the server. The simulated sending request is as follows:

Request Header:
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468 Host: localhost Connection: keep-alive Content-Length: 63135 sec-ch-ua: "Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110" Accept: application/json, text/plain, */* sec-ch-ua-mobile: ?0 Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImNhNDQ3N2YyLTM5ZDktNGU3Zi1iNjc3LTU5NDhlZTZmMWFiYSJ9.cFEYvyKY9yBnoeR15Li3s8h9B505SIgpGLwhruV0jZjjkmJjjKPxUJz-5eNxeTbu1epWLFO50fXy23zHvTON0Q User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 sec-ch-ua-platform: "Windows" Origin: http://localhost Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: http://localhost/user/profile Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: Admin-Token=eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImNhNDQ3N2YyLTM5ZDktNGU3Zi1iNjc3LTU5NDhlZTZmMWFiYSJ9.cFEYvyKY9yBnoeR15Li3s8h9B505SIgpGLwhruV0jZjjkmJjjKPxUJz-5eNxeTbu1epWLFO50fXy23zHvTON0Q

Request Body:
`---------------------------acebdf13572468
Content-Disposition: form-data; name="avatarfile"; filename="demo.png"
Content-Type: application/zip

<@include C:\Users\admin\Desktop\demo.zip@>
---------------------------acebdf13572468--`

1
2

@gitloghub
Copy link

你好好看看你在说什么?

@yangzongzhuan
Copy link
Owner

上传头像最新代码有进行限制,
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);

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

3 participants