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

studentmanager v1.0 has an arbitrary file upload vulnerability #16

Open
LvZCh opened this issue Dec 23, 2024 · 0 comments
Open

studentmanager v1.0 has an arbitrary file upload vulnerability #16

LvZCh opened this issue Dec 23, 2024 · 0 comments

Comments

@LvZCh
Copy link

LvZCh commented Dec 23, 2024

Source code name:studentmanager
Source code version:1.0
Source code download link:https://github.com/ZeroWdd/studentmanager/archive/refs/heads/master.zip

Vulnerability description:
The addStudent and editStudent methods in src/main/Java/com/wdd/studentmanager/controller/StudentController. java, as well as the addTeacher and editTeacher methods in src/main/Java/com/wdd/studentmanager/controller/TeacherController. java, do not restrict the file extension and content for uploading. JSP Trojan files and HTML files can be uploaded, but the system has a flaw. After uploading the file, the system needs to be restarted to access it, otherwise the uploaded file cannot be accessed.

Code Audit:
The addStudent and editStudent methods in src/main/Java/com/wdd/studentmanager/controller/StudentController.java, as well as the addTeacher and editTeacher methods in src/main/Java/com/wdd/studentmanager/controller/TeacherController.java, do not restrict the file extension or content of uploaded files
image
image

Vulnerability verification:
Select 1 student, click on modify
image
Upload JSP file
image
Return file name: a0e565a2-1266-4785-8dd2-3c186d082b18.jsp
image
Select another student and upload the HTML file
image
Return file name: bf0695d9-4ff2-44f8-872a-f32e584ade98.html
image
All have been uploaded to the src\main\resources\static\upload\imgs directory
image
You need to restart the project first to access the uploaded files
image
Open directly after restarting: http://192.168.0.102:8080/upload/imgs/bf0695d9 -4ff2-44f8-872a-f32e584ade98.html
image
However, accessing JSP files can only be downloaded locally: http://192.168.0.102:8080/upload/imgs/a0e565a2 -1266-4785-8dd2-3c186d082b18.jsp
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