/

CVE-2026-30934

Severity:

HIGH RISK

(8.9)

XSS in FileBrowser Quantum Share Metadata

CVE-2026-30934

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to arbitrary JavaScript execution in users' browsers

Severity:

HIGH RISK

(8.9)

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

FileBrowser Quantum contained a stored cross-site scripting (XSS) vulnerability in the metadata fields of shared links, such as the share title and description.

When a victim visited a publicly shared URL, unescaped metadata was rendered into HTML, allowing injected JavaScript to execute in the victim's browser and potentially compromise their session or data.

Affected context

This vulnerability appears in the public share feature of FileBrowser Quantum, specifically for URLs under /public/share/<hash>.

It is relevant when:

  • Users can create or modify share links and supply metadata (e.g., title, description, or similar fields).
  • Those metadata values are persisted on the server and later rendered into HTML for other users without context-aware escaping.
  • The application uses Go's text/template package instead of html/template to render the share page, causing user-controlled content to be injected into the DOM as raw HTML.

Any environment exposing publicly accessible or internally shared file links may be affected if these conditions hold.

Exploit preconditions

  • Attack surface: Public or internal share pages served at /public/share/<hash>.
  • Required access: Ability to create or edit a share and control its metadata fields (e.g., title, description). This typically requires an authenticated FileBrowser Quantum account or any workflow that lets an attacker influence share metadata.
  • Victim interaction: A victim must visit the crafted share URL in a browser for the injected script to execute.
  • Trigger point: Page rendering of the share metadata into HTML using text/template without HTML or JavaScript context-aware escaping.
  • Why exploitation is possible: User-controlled fields are inserted directly into the HTML response, and text/template does not automatically escape content for HTML contexts, enabling arbitrary HTML/JS injection (CWE-79).

Why this happens

The underlying flaw is improper output encoding when rendering user-controlled content into a web page.

Instead of using a context-aware templating engine that automatically escapes HTML, the application employs Go's text/template package, which is not designed for HTML output and therefore does not escape characters such as <, >, " and '.

As a result, share metadata fields like titles and descriptions are treated as trusted HTML and placed directly into the document structure.

This aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted input is introduced into a web page without appropriate encoding for its output context.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser when they visit a malicious share link.
  • Theft of cookies or other browser-accessible session data, depending on cookie flags and application design.
  • Unauthorized actions performed on behalf of the victim within the FileBrowser Quantum application (session riding within the same origin).
  • Injection of deceptive UI elements to phish credentials or trick users into performing sensitive actions.
  • Lateral movement within an internal network if administrators or privileged users are tricked into opening malicious share links.

General mitigation guidance

Effective mitigation focuses on enforcing strict output encoding for any user-controlled content rendered into HTML:

  • Prefer HTML-aware templating systems (e.g., Go's html/template) that automatically escape data for HTML, attribute, and URL contexts.
  • Ensure all user-supplied metadata fields are treated as plain text and encoded according to their output context (HTML body, attribute, URL, JavaScript string, etc.).
  • Centralize template rendering helpers so that escaping rules are consistent and harder to bypass.
  • Limit the ability to store or render raw HTML in metadata fields; if rich text is required, use a well-reviewed, whitelist-based sanitizer that strips active content such as <script>, event handlers, and javascript: URLs.
  • Apply the principle of least privilege in the browser by using CSP (Content Security Policy) to reduce the impact of any remaining XSS bugs (e.g., disallow inline scripts and restrict script sources).

How teams detect issues like this

High-level detection typically includes:

  • Static analysis: Rules that flag direct inclusion of user-controlled variables into templates rendered with text/template or other non-escaping engines for HTML output.
  • Template review: Manual or automated checks for templates where variables are interpolated inside <script> blocks, event handler attributes (e.g., onclick), or other sensitive contexts without explicit escaping helpers.
  • Security testing: Automated dynamic scans configured to test share metadata fields for reflective and stored XSS by inserting markers and checking for unescaped reflections in the resulting HTML.
  • Policy enforcement: Engineering guidelines that prohibit the use of generic text templating engines for HTML views, enforced by code review and possibly pre-commit hooks or CI checks.
  • Runtime monitoring: Web server logs and application monitoring tuned to identify suspicious payload patterns in metadata fields (e.g., <script>, onerror=, javascript:), while accounting for false positives.

Sources

SourceLink
github.comgithub.com/gtsteffaniak/filebrowser/releases/tag/v1.2.2-stable
github.comgithub.com/gtsteffaniak/filebrowser/releases/tag/v1.3.1-beta
github.comgithub.com/gtsteffaniak/filebrowser/security/advisories/GHSA-r633-fcgp-m532

Frequently asked

questions

Yes. An attacker who can create or influence share metadata can craft a malicious share link and send it to victims over email, chat, or other channels. Exploitation occurs remotely when the victim's browser loads the affected share page.

The attacker generally needs the ability to create or modify a share and control its metadata fields, which usually requires at least a basic user account or any integration that allows untrusted parties to set share titles or descriptions.

The most robust fix is to ensure that all HTML pages are rendered with an HTML-aware templating engine that performs context-sensitive escaping, and to treat all user-supplied fields as untrusted text that must be encoded before being inserted into the page.

Adopt a secure templating standard (e.g., always use html/template for HTML), encode-by-default patterns in view code, and add automated checks in CI to block usage of non-escaping template APIs for web pages. Complement this with secure coding guidelines, regular security reviews of user-facing templates, and, where feasible, browser-side defenses like Content Security Policy.

Find out what's already
exploitable in your codebase.