lsgwr / spring-boot-online-exam

基于Spring Boot的在线考试系统(预览地址 http://129.211.88.191 ,账户分别是admin、teacher、student,密码是admin123),也有Python实现
https://gitee.com/lsgwr/spring-boot-online-exam
MIT License
1.52k stars 541 forks source link

Insecure File Upload Vulnerability #62

Open Xiqinger opened 6 months ago

Xiqinger commented 6 months ago

1. PathTravel

The current implementation of the file upload functionality lacks proper filtering and validation of the uploaded file names. This allows attackers to upload files with malicious names that can potentially traverse to arbitrary paths on the server. By exploiting this vulnerability, an attacker can upload files to unintended directories, potentially compromising the system's integrity and confidentiality.

It is necessary to implement robust checks on the file name obtained from file.getOriginalFilename() to ensure it does not contain any path traversal sequences like "..". Additionally, validate the final path to ensure it falls within the intended directory specified by the "dir" parameter.

image

2. Duplicate File Uploads

The current implementation of the file upload feature does not include a file renaming mechanism. This poses a risk as it allows for the overwriting of existing files with the same name. This functionality gap can be exploited by attackers to maliciously overwrite files belonging to other users, leading to data loss or unauthorized access to sensitive information.

renanmin commented 6 months ago

这是来自QQ邮箱的疫情自动回复邮件。   您好,我最近正在疫情中,无法亲自回复您的邮件。我将在疫情结束后,尽快给您回复。