GHSA-xfvg-8v67-j7wp

Suggest an improvement
Source
https://github.com/advisories/GHSA-xfvg-8v67-j7wp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-xfvg-8v67-j7wp/GHSA-xfvg-8v67-j7wp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-xfvg-8v67-j7wp
Aliases
Published
2026-02-25T16:06:59Z
Modified
2026-02-25T16:18:56.591868Z
Severity
  • 6.8 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
TypiCMS Core has Stored Cross-Site Scripting (XSS) via SVG File Upload
Details

I. Summary

A Stored Cross-Site Scripting (XSS) vulnerability exists in the file upload module of TypiCMS. The application allows users with file upload permissions to upload SVG files. While there is a MIME type validation, the content of the SVG file is not sanitized. An attacker can upload a specially crafted SVG file containing malicious JavaScript code. When another user (such as an administrator) views or accesses this file through the application, the script executes in their browser, leading to a compromise of that user's session.

The issue is exacerbated by a bug in the SVG parsing logic, which can cause a 500 error if the uploaded SVG does not contain a viewBox attribute. However, this does not mitigate the XSS vulnerability, as an attacker can easily include a valid viewBox attribute in their malicious payload.

II. Vulnerability Details

  • Vulnerability Type: Stored Cross-Site Scripting (XSS) (CWE-79)
  • Affected Component: TypiCMS\Modules\Core\Http\Requests\FileFormRequest.php and TypiCMS\Modules\Core\Services\FileUploader.php.
  • Affected Versions: <= 16.0.5

The vulnerability stems from two main points:

  1. Permissive File Validation: The FileFormRequest explicitly whitelists svg as an allowed MIME type for uploads.
  2. Lack of Content Sanitization: The FileUploader service saves the SVG file to the server without parsing and sanitizing its content to remove potentially malicious elements like <script> tags or on* event handlers.

When the default filesystem disk is set to public, the uploaded SVG file is stored in a publicly accessible directory, making it trivial to access the file via a direct URL and trigger the XSS payload.

III. Proof of Concept (PoC)

  1. Create a Malicious SVG File: Create a file named malicious.svg with the following content. The viewBox attribute is included to bypass the application's parsing bug.

    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
        <script>
            // A simple PoC to demonstrate the vulnerability
            alert('XSS in TypiCMS! Your session cookie is: ' + document.cookie);
        </script>
        <text x="10" y="50">If you see this, the script has run.</text>
    </svg>
    
  2. Upload the Malicious File:

    • Log in to the TypiCMS admin panel as a user with permissions to upload files.
    • Navigate to the "Files" module (e.g., /admin/files).
    • Upload the malicious.svg file. The application will accept the file and store it. <img width="2540" height="1217" alt="image" src="https://github.com/user-attachments/assets/beb8ace9-ac39-442c-a2bc-3fbfb09f8c32" /> <img width="1718" height="671" alt="image" src="https://github.com/user-attachments/assets/9cd4a3f8-28e3-4223-8203-7ab292eaf95f" />
  3. Trigger the XSS:

    • The application will provide a public URL for the uploaded file, typically in the format http://<your-site>/storage/files/malicious.svg.
    • Anyone who navigates to this URL will have the embedded JavaScript executed in their browser.
    • An attacker can send this link to a privileged user (e.g., an administrator). When the administrator clicks the link, their session cookies can be stolen, or the attacker can perform actions on their behalf.

<img width="2091" height="704" alt="image" src="https://github.com/user-attachments/assets/99c915bb-a518-46aa-b237-390cd58f34e7" /> <img width="1457" height="996" alt="image" src="https://github.com/user-attachments/assets/0ed000ec-78cf-4ed8-8cd5-2886fbb2afc0" />

IV. Impact

Successful exploitation of this vulnerability allows an attacker to execute arbitrary JavaScript in the context of the victim's browser. Although the use of the HttpOnly flag on session cookies prevents direct theft of the session ID via document.cookie, the attacker can still achieve a full compromise of the victim's account by performing actions on their behalf.

The impact includes:

  • Account Takeover via Action Forgery: The attacker's script can make authenticated requests to the application's API from the victim's browser. This allows the attacker to perform any action the victim is authorized to do, such as:

    • Creating a new administrator account for the attacker.
    • Changing the victim's email address and password.
    • Deleting or modifying all content, users, and settings.
  • Sensitive Information Disclosure: The script can read the content of any page the victim views within the admin panel. This includes lists of users (with names and emails), private application settings, and other sensitive data, which can then be exfiltrated to an attacker-controlled server.

  • Phishing and Social Engineering: The script can manipulate the admin panel's UI to display fake login forms to trick the user into re-entering their credentials, or redirect them to a malicious website.

  • Keystroke Logging: The script can capture any information the victim types into forms on the compromised page.

Because the attacker can perform any action as an authenticated administrator, this vulnerability effectively leads to a full application compromise, even without direct access to the session cookie. The risk is High.

V. Recommended Patches and Mitigations

It is recommended to apply a defense-in-depth approach to mitigate this vulnerability.

  1. Primary Fix: Sanitize SVG Content: The most robust solution is to sanitize SVG files upon upload. Before saving the file, it should be parsed to remove all potentially dangerous elements, including <script>, <style>, <foreignObject> tags, and all on* event attributes. This can be achieved using a dedicated SVG sanitization library.

  2. Secondary Fix: Disable SVG Uploads: If SVG uploads are not a critical feature for the application, the simplest and most secure solution is to disable them entirely. This can be done by removing 'svg' from the list of allowed MIME types in TypiCMS\Modules\Core\Http\Requests\FileFormRequest.php.

    // In FileFormRequest.php
    // BEFORE:
    $fileRule = 'mimes:jpeg,gif,png,...,svg,...|max:...';
    
    // AFTER:
    $fileRule = 'mimes:jpeg,gif,png,...,pdf,...|max:...'; // Removed 'svg'
    
  3. Hardening - Content-Security-Policy (CSP): Implement a strict Content-Security-Policy (CSP) header for the application. A well-configured CSP can prevent the execution of inline scripts, which would mitigate the impact of this XSS vulnerability.

  4. Hardening - Serve User Content from a Separate Domain: Serve all user-uploaded files from a separate, cookie-less domain. This is a highly effective security measure that isolates user-generated content from the main application, preventing scripts from accessing session cookies or interacting with the application's DOM.

Database specific
{
    "github_reviewed_at": "2026-02-25T16:06:59Z",
    "nvd_published_at": "2026-02-25T03:16:06Z",
    "severity": "MODERATE",
    "cwe_ids": [
        "CWE-79"
    ],
    "github_reviewed": true
}
References

Affected packages

Packagist / typicms/core

Package

Name
typicms/core
Purl
pkg:composer/typicms/core

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
16.1.7

Affected versions

V2.*
V2.0.3
1.*
1.8.0
1.8.1
1.8.2
1.8.3
1.8.4
v1.*
v1.8.5
v1.8.6
v1.8.7
v2.*
v2.0.0
v2.0.1
v2.0.2
v2.0.4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20
3.0.21
3.0.22
3.0.23
3.0.24
3.0.25
3.0.26
3.0.27
3.0.28
3.0.29
3.0.30
4.*
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.0.5
5.*
5.0.0
5.0.1
5.0.2
5.0.3
5.0.4
5.0.5
5.0.6
5.0.7
5.0.8
5.0.9
5.0.10
5.0.11
5.0.12
5.0.13
5.0.14
5.0.15
5.0.16
5.0.17
5.0.18
5.0.19
5.0.20
5.0.21
5.0.22
5.0.23
5.0.24
5.0.25
5.0.26
5.0.27
5.0.28
5.0.29
5.0.30
5.0.31
5.0.32
5.0.33
5.0.34
5.0.35
5.0.36
5.0.37
5.0.38
6.*
6.0.0
6.0.1
6.0.2
6.0.3
6.0.4
6.0.5
6.0.6
6.0.7
6.0.8
6.0.9
6.0.10
6.0.11
6.0.12
6.0.13
6.0.14
6.0.15
6.0.16
6.0.17
6.0.18
6.0.19
7.*
7.0.0
7.0.1
7.0.2
7.0.3
7.0.4
7.0.5
7.0.6
7.0.7
7.0.8
7.0.9
7.0.10
7.0.11
7.0.12
7.0.13
7.0.14
7.0.15
7.0.16
7.0.17
7.0.18
7.0.19
7.0.20
7.0.21
7.0.22
7.0.23
7.0.24
7.0.25
7.0.26
7.0.27
7.0.28
7.0.29
7.0.30
7.0.31
7.0.32
7.0.34
7.0.35
7.0.36
7.0.37
7.0.38
7.0.39
7.0.40
7.0.41
7.0.42
7.0.43
7.0.44
7.0.45
7.0.46
7.0.47
7.0.48
7.0.49
7.0.50
7.0.51
7.0.52
8.*
8.0.0
8.0.1
8.0.2
8.0.3
8.0.4
8.0.5
8.0.6
8.0.7
8.0.8
8.0.9
8.0.10
8.0.11
9.*
9.0.0
9.0.1
9.0.2
9.0.3
9.0.4
9.0.5
9.0.6
9.0.7
9.0.8
9.0.9
9.0.10
9.0.11
9.0.12
9.0.13
9.0.14
9.0.15
9.0.16
9.0.17
9.0.18
9.0.19
9.0.20
9.0.21
9.0.22
9.0.23
9.0.24
9.0.25
9.0.26
9.0.27
9.0.28
9.0.29
9.0.30
9.0.31
9.0.32
9.0.33
9.0.34
9.0.35
9.0.36
9.0.37
9.0.38
9.0.39
9.0.40
9.0.41
9.0.42
9.0.43
9.0.44
9.0.45
9.0.46
9.0.47
9.0.48
9.0.49
9.0.50
9.0.51
9.0.52
9.0.53
9.0.54
9.0.55
9.0.56
9.0.57
9.0.58
9.0.59
9.0.60
9.0.61
9.0.62
9.0.63
9.0.64
10.*
10.0.0
10.0.1
10.0.2
10.0.3
10.0.4
10.0.5
10.0.6
10.0.7
10.0.8
10.0.9
10.0.10
10.0.11
10.0.12
10.0.13
10.0.14
10.0.15
10.0.16
10.0.17
10.0.18
10.0.19
10.0.20
10.0.21
10.0.22
10.0.23
10.0.24
10.0.25
10.0.26
10.0.27
10.0.28
10.0.29
10.0.30
10.0.31
10.0.32
10.0.33
10.0.34
10.0.35
10.0.36
10.0.37
10.0.38
10.0.39
10.0.40
10.0.41
10.0.42
10.0.43
10.0.44
10.0.45
10.0.46
10.0.47
10.0.48
10.0.49
10.0.50
10.0.51
10.0.52
11.*
11.0.0
11.0.1
11.0.2
11.0.3
11.0.4
11.0.5
11.0.6
11.0.7
11.0.8
11.0.9
11.0.10
11.0.11
11.0.12
11.0.13
11.0.14
11.0.15
11.0.16
11.0.17
11.0.18
11.0.19
11.0.20
11.0.21
11.0.22
11.0.23
11.0.24
11.0.25
11.0.26
11.0.27
11.0.28
11.0.29
11.0.30
11.0.31
11.0.32
11.0.33
11.0.34
11.0.35
11.0.36
11.0.37
11.0.38
11.0.39
11.0.40
11.0.41
11.0.42
12.*
12.0.0
12.0.1
12.0.2
12.0.3
12.0.4
13.*
13.0.0
13.0.1
13.0.2
13.0.3
13.0.4
13.0.5
13.0.6
13.0.7
13.0.8
14.*
14.0.0
14.0.1
14.0.2
14.0.3
14.0.4
14.0.5
14.0.6
14.0.7
14.0.8
14.0.9
14.0.10
14.0.11
14.0.12
14.0.13
14.0.14
14.0.15
14.0.16
14.0.17
14.0.18
14.0.19
14.0.20
14.0.21
14.0.22
14.0.23
14.0.24
14.0.25
14.0.26
15.*
15.0.0
15.0.2
15.0.3
15.0.4
15.0.5
15.0.6
15.0.7
15.0.8
15.0.9
15.0.10
15.0.11
15.0.12
15.0.13
15.0.14
15.0.15
15.0.16
15.0.17
15.0.18
15.0.19
15.0.20
15.0.21
15.0.22
15.0.23
15.0.24
15.0.25
15.0.27
15.0.28
16.*
16.0.0
16.0.1
16.0.2
16.0.3
16.0.4
16.0.5
16.0.6
16.0.7
16.0.8
16.0.9
16.0.10
16.0.11
16.0.12
16.0.13
16.0.14
16.0.15
16.0.16
16.0.17
16.0.18
16.0.19
16.0.20
16.0.21
16.0.22
16.0.23
16.0.24
16.0.25
16.0.26
16.1.0
16.1.1
16.1.2
16.1.3
16.1.4
16.1.5
16.1.6

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-xfvg-8v67-j7wp/GHSA-xfvg-8v67-j7wp.json"