Skip to main content

CVE-2026-54088 — Vulnerability in filebrowser/filebrowser/v2

CRITICAL

File Browser: Command Injection via Authentication Hook Shell Substitution (Pre-Authentication RCE)

Published July 10, 2026Updated July 21, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.76%). Schedule for your next planned update.

Does your project use an affected github.com/filebrowser/filebrowser/v2 version?

Paste your go.sum to check it for CVE-2026-54088 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Overview

The Hook Authentication feature in File Browser allows administrators to delegate login verification to an external shell command. User-supplied credentials (username and password) are interpolated into this command string using os.Expand without sanitization. An unauthenticated remote attacker can inject shell metacharacters in the username or password field at the login screen, causing the server to execute arbitrary OS commands before any authentication takes place. This is a critical pre-authentication RCE.

Affected Location

  • File: auth/hook.go
  • Function: HookAuth.RunCommand

CVSS v4.0

MetricValueRationale
Attack Vector (AV)Network (N)Exploitable via the login endpoint over HTTP from any network
Attack Complexity (AC)Low (L)Single crafted HTTP request; no preparation needed
Attack Requirements (AT)None (N)No race condition or special timing required
Privileges Required (PR)None (N)No account required — pre-authentication attack
User Interaction (UI)None (N)Fully automated; no victim action needed
Vulnerable System Confidentiality (VC)High (H)Full read access to server filesystem and env
Vulnerable System Integrity (VI)High (H)Arbitrary file write/modification
Vulnerable System Availability (VA)High (H)Can kill processes, exhaust resources
Subsequent System Confidentiality (SC)None (N)No direct impact on downstream systems assumed
Subsequent System Integrity (SI)None (N)—
Subsequent System Availability (SA)None (N)—

Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Base Score: 9.3 (Critical)

Note: PR:None is the critical differentiator from vulnerabilities 01 and 02. Because the injection point is the unauthenticated login endpoint, no account or session is required. A single HTTP request to the login API is sufficient to achieve RCE.

CWE

IDNameRole
CWE-78Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')Primary — attacker-supplied credentials embedded in shell command string via os.Expand
CWE-88Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')Secondary — $USERNAME/$PASSWORD expansion injects additional shell commands
CWE-306Missing Authentication for Critical FunctionSecondary — OS command execution is reachable before any authentication is verified

Technical Details

HookAuth.RunCommand builds the authentication command and substitutes credential values using os.Expand:

// auth/hook.go
envMapping := func(key string) string {
    switch key {
    case "USERNAME":
        return a.Cred.Username  // directly from the HTTP login request body
    case "PASSWORD":
        return a.Cred.Password  // directly from the HTTP login request body
    default:
        return os.Getenv(key)
    }
}

for i, arg := range command {
    if i == 0 { continue }
    command[i] = os.Expand(arg, envMapping) // no escaping applied
}

os.Expand performs plain text substitution. There is no escaping, quoting, or validation of the credential values before they are embedded into the command string.

If an admin has configured the hook authentication command as:

sh -c "test $USERNAME = 'admin'"

...and an attacker submits the username ; id # at the login screen, the expanded command becomes:

sh -c "test ; id # = 'admin'"

The ; terminates the test expression and the shell executes id. The # comments out the remainder, preventing a syntax error. The attacker's command runs with the privileges of the File Browser process — without needing a valid account or password.

Attack Scenario / Reproduction Steps

  1. Admin enables Hook Authentication and sets the command to:
    sh -c "test $USERNAME = 'admin'"
    
  2. An unauthenticated attacker sends a login request (e.g., via curl or the web UI) with:
    • Username: ; id #
    • Password: (any value)
  3. The server executes:
    sh -c "test ; id # = 'admin'"
    
  4. The id command runs on the server, confirming pre-authentication RCE.

No account is needed. The attacker does not need to know any valid credentials. A single request is sufficient.

Impact

An unauthenticated remote attacker can execute arbitrary OS commands on the server under the privilege level of the File Browser process. This is the most severe class of vulnerability in this codebase:

  • No authentication required — exposed to the entire internet if the service is public-facing.
  • Single request — no setup, no enumeration, no prior foothold.
  • Full server compromise: data exfiltration, persistent backdoor installation, lateral movement to internal networks.

Any internet-facing File Browser instance with Hook Authentication enabled is fully compromised by a single malformed login attempt.

Proof of Concept

package auth

import (
        "os"
        "strings"
        "testing"
)

func TestPoC_AuthHookInjection(t *testing.T) {
        // Simulate the admin-configured hook authentication command.
        // This represents a realistic configuration: verify the username via a shell expression.
        a := &HookAuth{
                Command: "sh -c $USERNAME",
                Cred: hookCred{
                        // Attacker-supplied username from the login form.
                        // The password is irrelevant.
                        Username: "id ; echo injected",
                        Password: "anything",
                },
        }

        // Simulate the RunCommand logic in auth/hook.go
        command := strings.Split(a.Command, " ")

        envMapping := func(key string) string {
                if key == "USERNAME" {
                        return a.Cred.Username
                }
                return os.Getenv(key)
        }

        for i, arg := range command {
                if i == 0 {
                        continue
                }
                // os.Expand substitutes $USERNAME with the attacker's input.
                // The result is treated as a shell script — no escaping is applied.
                command[i] = os.Expand(arg, envMapping)
        }

        // The shell will execute: sh -c "id ; echo injected"
        expectedArg := "id ; echo injected"
        if command[2] != expectedArg {
                t.Errorf("Expected command argument %q, got %q", expectedArg, command[2])
        }

        t.Logf("Confirmed: malicious username was injected as a shell script. Executing: %v", command)
}

Remediation

Pass credentials exclusively as environment variables, not as shell string substitutions. This feature is undocumented, so removing it should not cause issues.

Advisory Timeline

  • First published July 10, 2026 (139 days ago).
  • Last revised July 21, 2026 — 11 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/filebrowser/filebrowser/v2 to 2.63.6 or later
go get github.com/filebrowser/filebrowser/v2@v2.63.6

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/filebrowser/filebrowser/v2 Go · Affected: All versions2.63.6

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Frequently Asked Questions

What is CVE-2026-54088?
File Browser: Command Injection via Authentication Hook Shell Substitution (Pre-Authentication RCE). This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-54088?
CVE-2026-54088 affects github.com/filebrowser/filebrowser/v2. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-54088 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.76%
EPSS percentile: 51.7

This is an above-median EPSS score — 51.7% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-m93h-4hw7-5qcm
GO-2026-5962

Related CVEs

  • CVE-2026-55667
    HIGH

    File Browser: Out-of-scope file deletion by a Create-only scoped user via symlink-following RemoveAll in upload failure-cleanup

  • CVE-2026-32758
    MEDIUM

    File Browser has an Access Rule Bypass via Path Traversal in Copy/Rename Destination Parameter

  • CVE-2026-54093
    MEDIUM

    File Browser: FilePath traversal in download-as-zip/tar via Windows-style backslash separators in stored filenames

  • CVE-2026-25889
    MEDIUM

    File Browser has an Authentication Bypass in User Password Update

  • CVE-2026-54094

    File Browser: Symlink following lets scoped users read, overwrite, and share files outside their filebrowser scope in github.com/filebrowser/filebrowser

  • CVE-2026-54096

    File Browser: Improper Access Control Occurs via Pre-Created Public Share for a Non-existent Path in github.com/filebrowser/filebrowser

  • CVE-2026-35605

    File Browser has an access rule bypass via HasPrefix without trailing separator in path matching in github.com/filebrowser/filebrowser

  • CVE-2026-34529

    File Browser is vulnerable to Stored Cross-site Scripting via crafted EPUB file in github.com/filebrowser/filebrowser

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum