Piccolo Admin's raw SVG loading may lead to complete data compromise from admin page
Date: 2024-04
Affected: pip/piccolo-admin
Attack vector: xss
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2024-30248
CWE: CWE-79
CVSS: 7.7 (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N)

### Summary Piccolo's admin panel provides the ability to upload media files and view them within the admin panel. If SVG is an allowed file type for upload; the default; an attacker can upload an SVG which when loaded under certain contexts allows for arbitrary access to the admin page. This access allows the following actions for example: - The ability for an attacker to gain access to all data stored within the admin page - The ability for an attacker to make any action within the admin page such as creating, modifying or deleting table records As the SVG is executed from the context of an authenticated admin session, any actions they may be able to make can be made by the attacker. *N.b. The relevant session cookies are inaccessible from JavaScript due to httponly being set so all exploits must be present within the SVG file* ### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerability._ Currently, this requires the ability for a user to have access to an administrators account in order to upload the malicious file for simplicity sake. I can however imagine situations where general end users have the ability to upload files which can later be managed via the admin page. See the following repository: [Piccolo XSS](https://github.com/Skelmis/piccolo_xss) 1. Clone the repo 2. Run all migrations & create an admin user 3. Run `app.py` as a FastAPI application 4. Login to the admin page 5. Create a new task and upload the f


Mitigations:

Architectural layers (MAESTRO):