filebrowser allows Stored Cross-Site Scripting through the Markdown preview function
Published 27 Jun 2025 · Updated 4 Aug 2025
Is your project on an affected github.com/filebrowser/filebrowser/v2?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <2.33.7
- Fixed in
- 2.33.7
go get github.com/filebrowser/filebrowser/v2@v2.33.7- Affected
- <=1.11.0
- Fixed in
- No fix released
Details
Summary ##
The Markdown preview function of File Browser v2.32.0 is vulnerable to *Stored Cross-Site-Scripting (XSS)*. Any JavaScript code that is part of a Markdown file uploaded by a user will be executed by the browser
Impact ##
A user can upload a malicious Markdown file to the application which can contain arbitrary HTML code. If another user within the same scope clicks on that file, a rendered preview is opened. JavaScript code that has been included will be executed.
Malicious actions that are possible include:
- Obtaining a user's session token
- Elevating the attacker's privileges, if the victim is an administrator (e.g., gaining command execution rights)
Vulnerability Description ##
Most Markdown parsers accept arbitrary HTML in a document and try rendering it accordingly. For instance, if one creates a file called xss.md with the following content:
# Hallo <b>foo</b> <img src="xx" onerror=alert(9)> <i>bar</i>
Bold and italic text will be rendered. Also, the renderer used in File Browser will try to display the image and execute the code in the onerror event handler.
Proof of Concept ##
The screenshot shows that the code from the file mentioned above has actually been executed in the victim's browser:
!JavaScript code being executed in the Markdown Preview
Recommended Countermeasures ##
The most thorough fix would be to reconfigure the application's Markdown parser to ignore all HTML elements and only render rich text which is part of the Markdown specification. If HTML rendering is considered to be a required feature, an HTML sanitizer like DOMPurify should be used, preferably in conjunction with a *Content Security Policy* (CSP).
Timeline ##
2025-03-25Identified the vulnerability in version 2.32.02025-04-11Contacted the project2025-04-18Vulnerability disclosed to the project2025-06-25Uploaded advisories to the project's GitHub repository2025-06-26CVE ID assigned by GitHub2025-06-26Fix released with version 2.33.7
References ##
Credits ##
- Mathias Tausig (SBA Research)
Is GHSA-4wx8-5gm2-2j97 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/filebrowser/filebrowser/v2, and gives you the command that fixes it.
More advisories for github.com/filebrowser/filebrowser/v2
- LowCVE-2026-61874File Browser: Trailing-slash directory deletion leaves public shares active for recreated paths · 13 Nov 2026
- LowCVE-2026-55668File Browser: ScopedFs follows a dangling symlink on write, letting a scoped user create files outside their scope in github.com/filebrowser/filebrowser · 22 Jul 2026
- LowCVE-2026-55667File Browser: Out-of-scope file deletion by a Create-only scoped user via symlink-following RemoveAll in upload failure-cleanup in github.com/filebrowser/filebrowser · 22 Jul 2026
- LowCVE-2026-62685File Browser: Colliding username normalization gives two users the same home directory in github.com/filebrowser/filebrowser · 22 Jul 2026
- LowCVE-2026-62684File Browser: Share API exposes the password hash and bypass token in github.com/filebrowser/filebrowser · 22 Jul 2026
- LowCVE-2026-62843File Browser: Archive builder turns backslash filenames into path traversal (zip-slip) in github.com/filebrowser/filebrowser · 22 Jul 2026
References
- Linkgithub.com/filebrowser/filebrowser/security/advisories/GHSA-4wx8-5gm2-2j97
- Advisorynvd.nist.gov/vuln/detail/CVE-2025-52902
- Linkgithub.com/filebrowser/filebrowser/commit/f19943a42e8e092e811dffbe9f4623dac36f1f0d
- Packagegithub.com/filebrowser/filebrowser
- Linkgithub.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-04_Filebrowser_Stored_XSS
- Linkpkg.go.dev/vuln/GO-2025-3784
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.