/

CVE-2026-46489

Severity:

HIGH RISK

(8.1)

Stored XSS (CWE-79) via SVG Logo Upload in SolidInvoice

CVE-2026-46489

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-434

Impact:

Stored Cross-Site Scripting across authenticated users

Severity:

HIGH RISK

(8.1)

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

SolidInvoice contains a stored cross-site scripting flaw where uploaded SVG company logos can embed JavaScript that is injected unescaped into every page.

An authenticated administrator who uploads a malicious SVG can cause script execution in the browsers of all authenticated users, leading to widespread session and account compromise.

Affected context

The vulnerability appears in the company logo upload feature of SolidInvoice, where uploaded images are later rendered in authenticated areas of the application interface.

It manifests when SVG files are treated as arbitrary images without content validation, and their contents are injected into page templates without appropriate escaping or sanitization.

The risk is present in deployments where administrators can upload custom logos and where other authenticated users regularly load pages that display that logo.

Exploit preconditions

  • Attack surface: Web application interface, specifically the company logo upload endpoint.
  • Required access: Authenticated administrator-level access capable of uploading or changing the logo.
  • Trigger point: Rendering of the stored SVG logo on any page viewed by authenticated users after the upload.
  • Why exploitation is possible: The application accepts SVG files without validating content or type, then injects the raw SVG (including base64-encoded JavaScript) into pages without proper output encoding or sanitization, allowing script execution in user browsers.

Why this happens

The underlying issue combines improper input validation and output encoding.

SVG, being an XML-based format that can contain active content, is handled as a generic image without restricting or sanitizing embedded scripts, mapping to CWE-434: Unrestricted File Upload.

Additionally, the application injects user-controlled logo content into HTML responses without appropriate escaping, enabling script execution in the client, which maps directly to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The insecure pattern is trusting uploaded file content as harmless display data and reusing it across pages without enforcing a strict, non-executable representation.

Potential impact

  • Compromise of authenticated user sessions via stolen cookies or tokens.
  • Execution of arbitrary JavaScript in users' browsers, which can modify invoices, payment details, or account information.
  • Installation of malicious scripts that persist across sessions and pages for all authenticated users.
  • Lateral movement within the application by impersonating other users or administrators.
  • Reputation damage and regulatory exposure if sensitive financial or personal data is manipulated or exfiltrated.

General mitigation guidance

Mitigation centers on tightly controlling both file upload behavior and how uploaded content is rendered.

Typical patterns include:

  • Restricting accepted logo formats to non-executable image types (e.g., PNG, JPEG) and rejecting SVGs or stripping active content from them.
  • Applying server-side validation to ensure uploaded files match expected MIME types and internal structure, not just file extensions.
  • Ensuring all user-supplied or file-sourced content is properly escaped or encoded before insertion into HTML, attributes, or JavaScript contexts.
  • Serving uploaded assets from a separate domain or origin and treating them as static resources rather than injecting their raw contents into templates.
  • Limiting upload privileges to only those roles that strictly require it and applying least-privilege principles to how uploaded resources are used.

How teams detect issues like this

Organizations can detect similar issues by:

  • Employing static analysis rules that flag insertion of user-controlled data into HTML without appropriate encoding functions.
  • Reviewing upload handlers for lack of content-type checks, absence of magic-byte validation, and acceptance of complex formats like SVG without sanitization.
  • Conducting application security testing focused on file upload endpoints, including attempts to embed active content and verify its rendering behavior.
  • Applying security linters or automated code review tools that enforce standard encoding libraries and patterns for all template outputs.
  • Implementing centralized policies for media uploads that are verified during code review, ensuring consistent treatment of all uploaded assets.

Sources

SourceLink
github.comgithub.com/SolidInvoice/SolidInvoice/commit/8196c64df58b1226739f6ec4097fd6e7ba757860
github.comgithub.com/SolidInvoice/SolidInvoice/releases/tag/2.3.17
github.comgithub.com/SolidInvoice/SolidInvoice/security/advisories/GHSA-mqwm-r4g8-wf4w

Frequently asked

questions

The impact spans all authenticated users who load pages displaying the compromised logo, because the malicious script is stored and executed each time the logo is rendered, making it a persistent, application-wide XSS.

Successful exploitation requires authenticated administrator-level access or any account with permission to upload or change the company logo, as the attack vector is the logo upload feature.

A robust fix applies strict validation to file uploads, limits accepted formats to safe image types, sanitizes complex formats like SVG to remove active content if they must be supported, and ensures all injected or displayed user-controlled content is correctly escaped before reaching the browser.

Prevention relies on adopting a secure-by-default templating and upload architecture: always treat uploaded files as untrusted data, enforce centralized validation and sanitization routines, avoid inlining file contents directly into HTML, and mandate standardized output encoding for any data flowing from user input or file uploads into the UI.

Find out what's already
exploitable in your codebase.