Skip to content

Vikunja: Stored XSS via Unsanitized SVG Attachment Upload Leads to Token Exposure

High severity GitHub Reviewed Published Feb 25, 2026 in go-vikunja/vikunja • Updated Feb 27, 2026

Package

gomod code.vikunja.io/api (Go)

Affected versions

<= 0.24.6

Patched versions

None

Description

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>

  1. After uploading ,save the Task and open the project , copy the direct URL of the attachment.
  2. Open the attachment URL in a new browser tab.
  3. The embedded JavaScript executes immediately and displays the authentication token stored in localStorage.

This confirms that arbitrary JavaScript embedded in an uploaded SVG file executes within the application's context.

Impact

This vulnerability is classified as Stored Cross-Site Scripting (XSS).

Potential impact includes:

Execution of arbitrary JavaScript in a victim’s browser.
Exposure of authentication tokens.
Potential account takeover.
Ability to perform authenticated actions on behalf of the victim.
Possible privilege escalation if higher-privileged users open the malicious attachment.
Any authenticated user who accesses a malicious SVG attachment may be affected.

Recommendations

This vulnerability can be mitigated by implementing proper server-side sanitization of SVG uploads and preventing inline execution of uploaded files.

Specifically:

  • Sanitize all uploaded SVG files to remove <script> elements, event handlers (e.g., onload), and other executable content.
  • Serve attachments with Content-Disposition: attachment to prevent inline rendering.
  • Implement a strict Content Security Policy (CSP) to block script execution within uploaded files.
  • Store authentication tokens in HttpOnly, Secure cookies instead of localStorage to prevent JavaScript access.
  • Applying these controls will prevent stored XSS via SVG uploads and significantly reduce the risk of token exposure and account takeover.

Attachment
Stored XSS Proof of concept.pdf

A fix is available at https://github.com/go-vikunja/vikunja/releases/tag/v2.0.0.

References

@kolaente kolaente published to go-vikunja/vikunja Feb 25, 2026
Published by the National Vulnerability Database Feb 25, 2026
Published to the GitHub Advisory Database Feb 25, 2026
Reviewed Feb 25, 2026
Last updated Feb 27, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(11th percentile)

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

CVE ID

CVE-2026-27616

GHSA ID

GHSA-7jp5-298q-jg98

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.