CWE-79 · CWE-284
## Summary SVG files uploaded through the Curator media panel are stored and served inline without any sanitization. An authenticated user with permission to upload media can upload an SVG containing embedded JavaScript. When another panel user opens that file via the **View** action (which opens the media as a top-level browser document), the embedded script executes in the origin of the Filament application. `image/svg+xml` is included in the default accepted MIME types, so a default installation is affected unless SVG uploads have been explicitly disabled. ## Impact Because the SVG is served as a **top-level document** (not embedded in an `<img>` tag), any `<script>`, event-handler attribute (e.g. `onload`), or `javascript:` URI inside it runs with full script privileges in the application's origin. In a Filament admin context this can be leveraged to: - perform actions as the viewing user (typically a privileged administrator) via authenticated same-origin requests, - read same-origin data the victim's session can access, - exfiltrate cookies/tokens not protected from script access. The primary escalation path is a lower-privileged content author planting a payload that is later triggered when a higher-privileged user clicks **View** on the file. Panel thumbnails are **not** affected — they render through an `<img>` tag, which does not execute SVG script. ## Proof of concept 1. As a user who can upload media, upload an S