/

CVE-2026-27616

Severity:

HIGH RISK

(7.3)

Stored XSS in Vikunja Task Management Platform

CVE-2026-27616

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover / Session Compromise

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vikunja allowed users to upload SVG attachments that were stored and later rendered inline without sanitization, enabling embedded JavaScript to execute in the browser.

When a victim accessed a malicious SVG via its direct URL under the application's origin, attacker-supplied code could run in the context of the authenticated user and read sensitive data such as authentication tokens from localStorage.

Affected context

This vulnerability occurs in Vikunja's task attachment handling, specifically when SVG files are accepted as uploads and later served back to clients.

The risk arises when:

  • Users can upload arbitrary SVG files as task attachments
  • The server stores SVG content as-is, without sanitizing or stripping active content (e.g., <script> tags, event handlers)
  • The SVG is returned with a response that the browser interprets as same-origin document content (typically inline rendering)
  • Authentication or session tokens are accessible to JavaScript via browser storage (e.g., localStorage)

Exploit preconditions

  • Attack surface: Web interface for uploading and accessing task attachments, specifically SVG files.
  • Required access: Ability to upload attachments to a project, task, or workspace (typically any authenticated user with upload permissions).
  • Trigger point: A user (victim) visits or is tricked into visiting the direct URL of the malicious SVG, rendered under the Vikunja origin.
  • Why exploitation is possible:
  • SVG is an XML-based image format that allows embedded JavaScript and event handlers.
  • The application does not sanitize or transform SVG content before storing or serving it.
  • The browser treats the SVG as active content under the same origin as Vikunja, allowing access to localStorage and other DOM APIs.

Why this happens

The underlying issue is a classic stored cross-site scripting vulnerability arising from improper handling of user-supplied SVG files.

SVG is not a passive image format; it supports script execution and event-driven behaviors.

By accepting and serving SVGs without sanitization, the application effectively stores attacker-controlled scripts that are later executed in other users' browsers when the SVG is rendered.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted input (SVG content) is inserted into a web context without neutralization, enabling script execution in the application's origin.

Potential impact

  • Theft of authentication tokens stored in localStorage, enabling account takeover.
  • Impersonation of victims, including performing actions on their behalf within Vikunja.
  • Exfiltration of sensitive project or task data accessible to the victim.
  • Installation of persistent client-side backdoors that trigger whenever the malicious attachment is viewed.
  • Phishing or UI redressing attacks presented from the trusted Vikunja origin.

General mitigation guidance

Mitigation typically involves treating SVG and other active formats as potentially executable and untrusted content.

Defensive patterns include:

  • Avoiding inline rendering of user-supplied SVGs; serve them with a safe content type and appropriate Content-Disposition headers so that they are downloaded or rendered in a separate origin/isolated context.
  • Applying robust server-side sanitization to SVG files, stripping <script> tags, event handler attributes (e.g., onload, onclick), external references, and other active elements.
  • Restricting allowed upload file types to formats that cannot contain active content where possible (e.g., raster images only) or enforcing strict whitelists of allowed SVG elements and attributes.
  • Storing authentication/session tokens in httpOnly cookies instead of JavaScript-accessible storage to limit the blast radius of XSS.
  • Applying a Content Security Policy (CSP) that restricts inline scripts and controls the execution of scripts in SVG documents, recognizing that CSP support for SVG varies by browser and should be considered a defense-in-depth measure rather than a sole protection.

How teams detect issues like this

Detection can focus on both code-level and runtime behaviors:

  • Static analysis: Search for code paths that:
  • Accept and store SVG or other user-supplied content without sanitization.
  • Serve these files back with content types or headers that allow inline rendering under the main application origin.
  • Code review signals:
  • Direct storage and replay of file uploads without transformation or validation.
  • Lack of server-side sanitization libraries or checks specifically for SVG or HTML-like inputs.
  • Usage patterns where attachments are embedded directly into HTML or returned as text/XML rather than as passive downloads.
  • Runtime and logging:
  • Monitor attachment access logs for unusual patterns of SVG access, especially from multiple users.
  • Use security scanners or DAST tools configured to upload active SVG payloads and observe whether script execution occurs.
  • Policy enforcement:
  • Implement CI/CD checks that flag new endpoints or changes that introduce unsanitized upload/serve flows, especially for formats capable of scripting.

Sources

SourceLink
github.comgithub.com/go-vikunja/vikunja/security/advisories/GHSA-7jp5-298q-jg98
github.comgithub.com/user-attachments/files/25414870/Stored.XSS.Proof.of.concept.pdf
vikunja.iovikunja.io/changelog/vikunja-v2.0.0-was-released

Frequently asked

questions

Yes. A remote attacker with the ability to register or access an account and upload attachments can exploit this by uploading a malicious SVG and then convincing another user to access the direct URL of that attachment.

Typically no. Any user with permissions to upload task attachments can introduce a malicious SVG. The victims are other authenticated users who view or open the attachment URL under the Vikunja origin.

The most robust approach is to prevent execution of user-supplied scripts altogether by not rendering SVGs inline from the main application origin, combining this with strong server-side SVG sanitization or restricting uploads to non-executable image types. Moving authentication tokens to httpOnly cookies further limits what XSS can steal.

Treat all user-controlled files as untrusted, especially formats like SVG that can contain active content. Apply consistent input validation, format-specific sanitization, and strict output encoding. Incorporate security review for upload and rendering paths, enforce secure storage of authentication tokens, and integrate automated checks for XSS patterns into the development pipeline.

Find out what's already
exploitable in your codebase.