Skip to content

FileBrowser Vulnerable to Stored XSS via SVG File in Public Share (Missing CSP Header)

Moderate severity GitHub Reviewed Published May 1, 2026 in gtsteffaniak/filebrowser

Package

gomod github.com/gtsteffaniak/filebrowser (Go)

Affected versions

< 0.0.0-20260501184955-6bfc3974192e

Patched versions

0.0.0-20260501184955-6bfc3974192e

Description

Summary

FileBrowser Quantum serves inline SVG files without a Content-Security-Policy header, allowing embedded JavaScript in SVG files to execute when accessed via public share links.

Verified on v1.3.0-stable.

Affected product

  • Product: FileBrowser Quantum (gtsteffaniak/filebrowser)
  • Verified version: v1.3.0-stable
  • Docker image: gtstef/filebrowser:latest
  • Affected endpoint: GET /public/api/resources/download?hash=HASH&inline=true
  • CWE: CWE-79 — Cross-site Scripting (Stored)

Impact

  • Stored XSS — Malicious SVG persists and executes for every visitor to the share link
  • No authentication required to trigger — Public share links are accessible to anyone
  • Session hijacking — If authenticated users click the link, their session can be stolen
  • Phishing — Attacker can redirect or overlay fake login forms

Reproduction

  1. Login as any user with upload permission
  2. Upload SVG file:
    <svg xmlns="http://www.w3.org/2000/svg">
      <script>alert(document.domain)</script>
    </svg>
  3. Create public share for the file
  4. Access the share link with ?inline=true
  5. JavaScript executes in browser

Root cause

The inline download endpoint returns SVG files with:

Content-Type: image/svg+xml
Content-Disposition: inline; filename="xss.svg"
X-Content-Type-Options: nosniff

But no CSP header to block script execution. The upstream project (filebrowser/filebrowser) mitigates this with:

Content-Security-Policy: script-src 'none'

Suggested fix

Add CSP header on inline file downloads:

w.Header().Set("Content-Security-Policy", "script-src 'none'")

This matches the upstream filebrowser/filebrowser implementation.

References

@gtsteffaniak gtsteffaniak published to gtsteffaniak/filebrowser May 1, 2026
Published to the GitHub Advisory Database May 7, 2026
Reviewed May 7, 2026

Severity

Moderate

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
Changed
Confidentiality
Low
Integrity
Low
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:C/C:L/I:L/A:N

EPSS score

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

No known CVE

GHSA ID

GHSA-mmpx-jh39-wrv6

Credits

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