ChestnutCMS File Upload Vulnerability Allowing Unrestricted File Types

Vulnerability

A file upload vulnerability has been identified in ChestnutCMS versions through 1.5.0. The issue arises in the /api/member/avatar API endpoint, which accepts a base64-encoded image string. This string is processed by the memberService.uploadAvatarByBase64 method, where the image is decoded and saved to a file without proper validation of the file extension. This vulnerability is particularly concerning because it is exposed to the frontend, allowing for potentially harmful files to be uploaded.

Impact

Exploitation of this vulnerability allows for unrestricted file uploads, which could be used to upload malicious files such as web shells or executable scripts, depending on the server's file handling and execution policies.

Reproduction

To reproduce this vulnerability, log into the application and navigate to the /api/member/avatar endpoint. Use a tool like Burp Suite to intercept the request and modify the 'image' parameter to include a base64-encoded string of an HTML file or an image file. After sending the request, the uploaded file can be accessed from the server.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
1.0
impact
7.5
exploitability
6.8
remediation
0.0
relevance
0.0
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.