-
Notifications
You must be signed in to change notification settings - Fork 32
Avatar upload leads to stored XSS #27
Description
Hi,
I would like to report a security vulnerability in FormCMS.
An authenticated attacker can upload a malicious .html file through the avatar upload endpoint (/api/profile/avatar). After uploading, the server stores the file at a publicly accessible location (/files/avatar/[random-id].html). The public URL of the uploaded file can be retrieved via a separate endpoint, allowing the attacker to obtain and share the exact link.
This file is accessible without authentication or access control. If a higher-privileged user, such as a Super Admin, visits the link—either directly or through social engineering—the embedded JavaScript executes in the context of their session. This allows the attacker to perform unauthorized API actions on behalf of the victim, such as full CRUD operations on users, roles, and other sensitive application-specific data.
I am happy to provide a proof-of-concept or further details if needed.
Edit: Affected version is v0.5.5