Vikunja: Stored XSS via Unsanitized SVG Attachment Upload Leads to Token Exposure
Date: 2026-02
Affected: go/code.vikunja.io/api
Attack vector: xss
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2026-27116
CVE-2026-27616
CWE: CWE-116
CWE-79
CWE-80
CVSS: 7.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N)

**Details** The application allows users to upload SVG files as task attachments. SVG is an XML-based format that supports JavaScript execution through elements such as <script> tags or event handlers like onload. The application does not sanitize SVG content before storing it. When the uploaded SVG file is accessed via its direct URL, it is rendered inline in the browser under the application's origin. As a result, embedded JavaScript executes in the context of the authenticated user. Because the authentication token is stored in localStorage, it is accessible via JavaScript and can be retrieved by a malicious payload. Key security issues identified: _No server-side sanitization of SVG content. SVG attachments are rendered inline instead of being forced as a download. Embedded JavaScript within SVG files is allowed to execute. Authentication tokens stored in localStorage are accessible to client-side scripts._ **PoC** _**Tested Environment**_ [ ] Application version: 1.1.0 [ ] Deployment type: Self-hosted **Steps to Reproduce** 1. Log in to an account. 2. Go to Projects and Create a new task or open an existing task. 3. Upload the following SVG file as an attachment: ``` <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <svg onload="alert(localStorage.getItem('token'))" xmlns="http://www.w3.org/2000/svg"> </svg> ``` 4. After uploading ,save the Task and open the project , copy the direct URL of the attachment. 5. Open the attachment URL in a new browser


Mitigations:

Architectural layers (MAESTRO):