TypiCMS Core — Stored XSS via Unsanitized SVG File Upload (CVE-2026-27621)
by Lukasz Rybak · 2026-07-05
- Severity
- Medium
- CVE
- CVE-2026-27621 (GHSA-xfvg-8v67-j7wp)
- Category
- web
- Affected product
- TypiCMS Core (typicms/core)
- Affected versions
- < 16.1.7 (advisory), PoC references affected versions <= 16.0.5
- Disclosed
- 2026-07-05
- Patch status
- patched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-04 |
| Author / Researcher | Lukasz Rybak |
| CVE / Advisory | CVE-2026-27621 (GHSA-xfvg-8v67-j7wp) |
| Category | web |
| Severity | Medium |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | typicms, stored-xss, svg-upload, cwe-79, cms, file-upload, laravel, session-hijack |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | TypiCMS Core (typicms/core) |
| Versions Affected | < 16.1.7 (advisory), PoC references affected versions <= 16.0.5 |
| Language / Platform | PHP/Laravel-based CMS; PoC payload is a crafted SVG file |
| Authentication Required | Yes (attacker needs file-upload permission) |
| Network Access Required | Yes |
Summary
TypiCMS Core allows users with file-upload permission to upload SVG files, validating only the MIME type without sanitizing the SVG’s internal content. Because SVG is an XML-based format that can embed <script> tags, an attacker can upload a malicious SVG containing JavaScript that executes whenever a victim (such as an administrator) views or accesses the file directly. A parsing bug in TypiCMS also causes a 500 error on SVGs lacking a viewBox attribute, but this is trivially bypassed by including a valid viewBox in the crafted payload. Since uploaded files are typically stored on the public disk, the malicious SVG becomes reachable via a direct, publicly accessible URL.
Vulnerability Details
Root Cause
FileFormRequest whitelists svg as an allowed upload MIME type, and FileUploader stores the file content as-is without parsing out dangerous elements (<script>, event handler attributes such as on*), enabling stored Cross-Site Scripting (CWE-79).
Attack Vector
- Craft a malicious SVG file containing a
<script>tag (e.g., readingdocument.cookie) and a validviewBoxattribute to avoid triggering the unrelated parser bug. - Log in to the TypiCMS admin panel as a user with file-upload permission and upload the SVG via the Files module (
/admin/files). - TypiCMS stores the file and exposes it at a public URL such as
http://<site>/storage/files/malicious.svg. - Send the link to a privileged user (e.g., an administrator); when they open it directly, the embedded JavaScript executes in their browser session, allowing forged authenticated actions, data exfiltration, or UI manipulation (fake login prompts, keylogging).
Impact
Even though HttpOnly cookies prevent direct session-cookie theft, the attacker’s script can perform authenticated actions as the victim (e.g., creating a new admin account, changing credentials, deleting content) and read/exfiltrate sensitive admin-panel data, amounting to full application compromise when a privileged user is targeted.
Environment / Lab Setup
Target: TypiCMS Core <= 16.0.5 with public filesystem disk configured for uploads
Attacker: Any modern web browser; a TypiCMS account with file-upload permission
Proof of Concept
PoC Script
See
malicious.svgin this folder (payload extracted from the source README).
| |
Uploading this SVG through the Files module and then navigating to its public URL executes the embedded <script> in the viewer’s browser session, demonstrating the stored XSS (the PoC payload shows a cookie-revealing alert() as evidence).
Detection & Indicators of Compromise
Signs of compromise:
- SVG files in the public uploads directory containing embedded
<script>tags or JS event handlers. - Unexplained new administrator accounts, changed credentials, or content modifications shortly after an admin views a shared file link.
- Outbound network requests from admin sessions to unfamiliar third-party domains (exfiltration).
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade to TypiCMS Core 16.1.7 or later, which addresses GHSA-xfvg-8v67-j7wp |
| Interim mitigation | Remove svg from allowed upload MIME types, sanitize SVG content (strip <script>, <style>, <foreignObject>, on* attributes) before storage, enforce a strict CSP, and serve user-uploaded content from a separate cookie-less domain |
References
Notes
Mirrored from https://github.com/lukasz-rybak/CVE-2026-27621 on 2026-07-05.