| 제목 | amirhamza05 Student-Management-System 1.0 Avatar Upload Allows PHP Execution (GetShell) |
|---|
| 설명 | A remote code execution vulnerability exists in the user avatar upload functionality. The server extracts the file extension from the client-supplied filename using `end(explode('.', $_FILES["file"]["name"]))` and constructs the destination filename as `user_<user_id>.<ext>`. The resulting file is written with `move_uploaded_file()` into `./upload/user_photo/`, which is a web-accessible directory inside the application's web root and is served from the same origin as the application.
The server performs no server-side validation of the file extension, MIME type, file header, or image decoding. The only extension check present is in the client-side JavaScript (`user_profile.js:37-42`), which restricts uploads to `gif/png/jpg/jpeg` but can be bypassed trivially. The upload directory contains an empty `.htaccess` file and no rules preventing script execution. By contrast, the student avatar upload branch in `student_action.php:59,128` does enforce a `jpeg/jpg/png` allowlist, indicating that the user avatar branch is an oversight rather than an intentional design choice.
As a result, an authenticated user can upload a `.php` file containing arbitrary PHP code. The predictable filename `user_<user_id>.php` allows the attacker to access the uploaded file directly, and the server executes it in the context of the web server process. |
|---|
| 원천 | ⚠️ https://github.com/amirhamza05/Student-Management-System/issues/75 |
|---|
| 사용자 | Autumoon (UID 102409) |
|---|
| 제출 | 2026. 10. 24. AM 11:43 (1 월 ago) |
|---|
| 모더레이션 | 2026. 11. 23. PM 07:31 (1 month later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 442503 [amirhamza05 Student-Management-System 까지 449397e35d42e3779f14f0bfc654ab307103f7e3 User Avatar Upload student_action.php move_uploaded_file 권한 상승] |
|---|
| 포인트들 | 20 |
|---|