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).
{
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-09T19:48:15Z",
"nvd_published_at": "2026-03-10T18:18:53Z",
"severity": "HIGH"
}