javahuang / SurveyKing

Make a better survey system.
https://surveyking.cn
MIT License
3.34k stars 506 forks source link

Arbitrary file upload vulnerability exists in unauthorized interfaces #51

Open l0nLychen opened 9 months ago

l0nLychen commented 9 months ago

version:v1.5.0,v1.6.0 The file upload interface /api/public/upload is not authenticated, so no authenticated users can upload files. image

When generating the file name, the risk of directory traversal was not considered, so the randomly generated sequence and ../../../12.jar were spliced ​​together and returned as the file name, resulting in directory traversal. image Here it is determined whether the suffix is ​​in the whitelist, but no further processing is done, and the execution proceeds directly, resulting in the ability to upload any type of file. image

This vulnerability can upload arbitrary files and overwrite the original files. You can overwrite scheduled task files in the system to achieve rebound shell, upload ssh key, overwrite passwd, shadow and other arbitrary files. There are significant security risks. image image