| Package | Affected versions | Patched versions |
|---|---|---|
| github.com/gtsteffaniak/filebrowser | < 0.0.0-20260307130210-09713b32a5f6 | 0.0.0-20260307130210-09713b32a5f6 |
| filebrowser | = 1.2.1= 1.3.0≤ 1.2.9 |
Stored XSS is possible via share metadata fields (e.g., title, description) that are rendered into HTML for /public/share/<hash> without context-aware escaping. The server uses text/template instead of html/template, allowing injected scripts to execute when victims visit the share URL.
The server renders public/index.html using text/template and injects user-controlled share fields (title/description/etc.) into HTML contexts. text/template does not perform HTML contextual escaping like html/template. Because share metadata is persistent, the payload becomes stored and executes whenever a victim opens the affected share page.
Relevant code paths:
backend/http/static.go (template rendering and share metadata assignment)backend/http/httpRouter.go (template initialization)frontend/public/index.html (insertion points for title/description and related fields)POST /api/share) with malicious metadata:
title = </title><script>alert("xss")</script><title>/public/share/<hash> URL in a browser.Tested on Docker image: gtstef/filebrowser:stable (version v1.2.1-stable).
Running one of these products? Scan your site to see whether it exposes a vulnerable version.
Scan my site free