OS Command Injection in github.com/filebrowser/filebrowser/v2 (CVE-2026-35585)
Summary
OS command injection in github.com/filebrowser/filebrowser/v2 (CVE-2026-35585). Successful exploitation can lead to full system takeover. Exploitable via os.Expand. Mitigation: upgrade to 2.33.8 or later.
Original description
The description as published by the source.
[!NOTE]
This feature has been disabled by default for all installations from v2.33.8 onwards, including for existent installations. To exploit this vulnerability, the instance administrator must turn on a feature and ignore all the warnings about known vulnerabilities. We're publishing this new advisory to make it clear that all vulnerabilities concerning this feature are disclosed.For more information about tracking vulnerability issues related to the Command Execution features, check https://github.com/filebrowser/filebrowser/issues/5199.
Overview
The hook system in File Browser — which executes administrator-defined shell commands on file events such as upload, rename, and delete — is vulnerable to OS command injection. Variable substitution for values like $FILE and $USERNAME is performed via os.Expand without sanitization. An attacker with file write permission can craft a malicious filename containing shell metacharacters, causing the server to execute arbitrary OS commands when the hook fires. This results in Remote Code Execution (RCE).
Affected Location
- File:
runner/runner.go - Function:
Runner.exec
Technical Details
Runner.exec expands template variables inside hook command strings using os.Expand:
// runner/runner.go
envMapping := func(key string) string {
switch key {
case "FILE":
return path // attacker-controlled filename
case "USERNAME":
return username // attacke…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-35585 has been found in github.com/filebrowser/filebrowser/v2.
Attackers can target a specific entry point like os.Expand over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 7.2/10.
What to do: upgrade github.com/filebrowser/filebrowser/v2 to 2.33.8 or later.
If unsure, ask your IT team or search "github.com/filebrowser/filebrowser/v2 CVE-2026-35585" on the vendor's site.
CVE-2026-35585 (github.com/filebrowser/filebrowser/v2) — CWE-78 / CVSS v3 7.2
Attack vector: remote (network-reachable) / no user interaction
Attack surface: os.Expand / Runner.exec / echo / before_upload
Patched: 2.33.8 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
OS command injection (CWE-78) exists in github.com/filebrowser/filebrowser/v2. Attackers reach the vulnerable code path via os.Expand.
Check the vendor advisory for the affected versions of github.com/filebrowser/filebrowser/v2. Attack surface: os.Expand / Runner.exec / echo / before_upload.
Severity: High (CVSS 7.2/10). Successful exploitation can lead to full system takeover.
Update to 2.33.8.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/filebrowser/filebrowser/v2' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/filebrowser/filebrowser/v2' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/filebrowser/filebrowser/v2を grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade github.com/filebrowser/filebrowser/v2 to 2.33.8ステージング環境で 2.33.8 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com