DedeCMS-V5.7.160 with Backend Reflected Cross-Site Scripting in backend /dede/upload.php.
Description
Backend image file upload with reflected-XSS in uploaded filename.
Affected Version
DedeCMS <= 5.7.160
POC
Login to admin backend management.
In /dede/upload.php, upload an new image file named “file”, with the filename contains XSS payload, e.g. <img src=x onerror=alert(1)>.png.
The uploaded filename must ends with a normal image extension, e.g. .png or .jpeg, and the file content must contains the legal image file header, filename should not contains and / or \.
The response of /dede/upload.php contains the XSS payload with the text/html content-type.
In source code, the filename is directly passed through the pathinfo function and assigned to $res['remark'], and finally echoed json encoded array, which contains the XSS payload, and by default, the response content-type is text/html.