CVE-2025-52995: Github.com/filebrowser/filebrowser/v2 File Browser Vulnerable To Command Vulnerability

HIGH
Advisory Identifier: GHSA-w7qc-6grj-w7r8
CVSS 8.0
CWE-77
Published
Advisory Summary

CVE-2025-52995 is a HIGH (CVSS 8.0) file browser vulnerable to command vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Github.com/filebrowser/filebrowser/v2 libraries in the Go ecosystem. The issue involves file browser vulnerable to command execution allowlist bypass. Remediation is available by upgrading affected packages to version 2.33.10.

CVE-2025-52995 at a Glance

CVE Identifier CVE-2025-52995
GHSA Identifier GHSA-w7qc-6grj-w7r8
Severity HIGH
CVSS v3.1 Base Score 8.0
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Github.com/filebrowser/filebrowser/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-52995

To remediate this vulnerability, upgrade all affected Github.com/filebrowser/filebrowser/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/filebrowser/filebrowser/v2 fixed: 2.33.10
Upgrade github.com/filebrowser/filebrowser/v2 to 2.33.10
github.com/filebrowser/filebrowser fixed: Latest secure release
Upgrade github.com/filebrowser/filebrowser to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/filebrowser/filebrowser/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-52995, inspect your project dependencies for Github.com/filebrowser/filebrowser/v2:

inspect dependencies for github.com/filebrowser/filebrowser/v2

Analyze the terminal output to locate any version of Github.com/filebrowser/filebrowser/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.33.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Github.com/filebrowser/filebrowser/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary ## The *Command Execution* feature of Filebrowser only allows the execution of shell command which have been predefined on a user-specific allowlist. The implementation of this allowlist is erroneous, allowing a user to execute additional commands not permitted. ## Impact ## A user can execute more shell commands than they are authorized for. The concrete impact of this vulnerability depends on the commands configured, and the binaries installed on the server or in the container image. Due to the missing separation of *scopes* on the OS-level, this could give an attacker access to all files managed the application, including the File Browser database. ## Vulnerability Description ## For a user to make use of the command execution feature, two things need to happen in advance: 1. An administrator needs to grant that account the `Execute commands` permission 2. The command to be executed needs to be listed in the `Commands` input field (also done by an administrator) If a user tries to execute a different command, it gets rejected by the application. The allowlist verification of a command happens in the function `CanExecute` in the file `users/users.go`: ```go // CanExecute checks if an user can execute a specific command. func (u *User) CanExecute(command string) bool { if !u.Perm.Execute { return false } for _, cmd := range u.Commands { if regexp.MustCompile(cmd).MatchString(command) { return true } } return false } ``` This check employs a regular expression which does not test if the command issued (`command`) is identical to a configured one (`cmd`, part of the array `u.Commands`) but rather only if the issued command contains an allowed one. This has the consequence, that, e.g., if you are only granted access to the `ls` command, you will also be allowed to execute `lsof` and `lsusb`. As a prerequisite, an attacker needs an account with the `Execute Commands` permission and some permitted commands. ## Proof of Concept ## Grant a user the `Execute commands` permission and allow them to use only `ls` in the `Commands` field. ![image](https://github.com/user-attachments/assets/30b84315-16bd-4b8f-ba30-2a395c89f002) Afterwards, login as that user, open a command execution window and execute `lsof` and `lsusb`. ![image](https://github.com/user-attachments/assets/f40baf90-832e-4ced-a596-bc75cf691549) ## Recommended Countermeasures ## The `CanExecute` function in the *Filebrowser* source code should be fixed to only allow exact matches of the command specified instead of doing partial matching. The correctness of this fix should be extensively tested in the application's automated test suite. ## Timeline ## * `2025-03-25` Identified the vulnerability in version 2.32.0 * `2025-04-11` Contacted the project * `2025-04-18` Vulnerability disclosed to the project * `2025-06-25` Uploaded advisories to the project's GitHub repository * `2025-06-25` CVE ID assigned by GitHub * `2025-06-26` Fix released in version 2.33.10 ## References ## * [Original Advisory](https://github.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-05_Filebrowser_Bypass_Command_Execution_Allowlist) ## Credits ## * Mathias Tausig ([SBA Research](https://www.sba-research.org/))

CVE-2025-52995 Affected Github.com/filebrowser/filebrowser/v2 Versions

2 component(s)
Fixed Versions:
2.33.10
Product / Package Ecosystem Affected Versions Fixed Version
github.com/filebrowser/filebrowser/v2
Go
< 2.33.10
2.33.10
github.com/filebrowser/filebrowser
Go
≤ 1.11.0

References

Frequently Asked Questions

What is CVE-2025-52995?
CVE-2025-52995 is a security vulnerability in Github.com/filebrowser/filebrowser/v2 involving File Browser vulnerable to command execution allowlist bypass under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Github.com/filebrowser/filebrowser/v2 versions are affected?
Affected versions include releases prior to 2.33.10 across affected packages: github.com/filebrowser/filebrowser/v2, github.com/filebrowser/filebrowser.
What version fixes CVE-2025-52995?
Upgrading to 2.33.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/filebrowser/filebrowser/v2 affected?
Yes, github.com/filebrowser/filebrowser/v2 is affected in releases prior to 2.33.10. Upgrade your dependency to 2.33.10 or later.
Is github.com/filebrowser/filebrowser affected?
Yes, github.com/filebrowser/filebrowser is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-52995?
CVE-2025-52995 has a CVSS v3.1 base score of 8.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2025-52995?
CVE-2025-52995 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2025-52995?
Run the dependency tree command: 'inspect dependencies for github.com/filebrowser/filebrowser/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w7qc-6grj-w7r8",
  "modified" : "2025-08-04T20:32:20Z",
  "published" : "2025-06-30T17:46:22Z",
  "aliases" : [ "CVE-2025-52995" ],
  "summary" : "File Browser vulnerable to command execution allowlist bypass",
  "details" : "## Summary ##\n\nThe *Command Execution* feature of Filebrowser only allows the execution of shell command which have been predefined on a user-specific allowlist. The implementation of this allowlist is erroneous, allowing a user to execute additional commands not permitted.\n\n## Impact ##\n\nA user can execute more shell commands than they are authorized for. The concrete impact of this vulnerability depends on the commands configured, and the binaries installed on the server or in the container image. Due to the missing separation of *scopes* on the OS-level, this could give an attacker access to all files managed the application, including the File Browser database.\n\n## Vulnerability Description ##\n\nFor a user to make use of the command execution feature, two things need to happen in advance:\n\n1. An administrator needs to grant that account the `Execute commands` permission\n2. The command to be executed needs to be listed in the `Commands` input field (also done by an administrator)\n\nIf a user tries to execute a different command, it gets rejected by the application.\n\nThe allowlist verification of a command happens in the function `CanExecute` in the file `users/users.go`:\n\n```go\n// CanExecute checks if an user can execute a specific command.\nfunc (u *User) CanExecute(command string) bool {\n\tif !u.Perm.Execute {\n\t\treturn false\n\t}\n\n\tfor _, cmd := range u.Commands {\n\t\tif regexp.MustCompile(cmd).MatchString(command) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n```\n\nThis check employs a regular expression which does not test if the command issued (`command`) is identical to a configured one (`cmd`, part of the array `u.Commands`) but rather only if the issued command contains an allowed one.\nThis has the consequence, that, e.g., if you are only granted access to the `ls` command, you will also be allowed to execute `lsof` and `lsusb`.\n\nAs a prerequisite, an attacker needs an account with the `Execute Commands` permission and some permitted commands.\n\n## Proof of Concept ##\n\nGrant a user the `Execute commands` permission and allow them to use only `ls` in the `Commands` field.\n\n![image](https://github.com/user-attachments/assets/30b84315-16bd-4b8f-ba30-2a395c89f002)\n\nAfterwards, login as that user, open a command execution window and execute `lsof` and `lsusb`.\n\n![image](https://github.com/user-attachments/assets/f40baf90-832e-4ced-a596-bc75cf691549)\n\n## Recommended Countermeasures ##\n\nThe `CanExecute` function in the *Filebrowser* source code should be fixed to only allow exact matches of the command specified instead of doing partial matching.\nThe correctness of this fix should be extensively tested in the application's automated test suite.\n\n## Timeline ##\n\n* `2025-03-25` Identified the vulnerability in version 2.32.0\n* `2025-04-11` Contacted the project\n* `2025-04-18` Vulnerability disclosed to the project\n* `2025-06-25` Uploaded advisories to the project's GitHub repository\n* `2025-06-25` CVE ID assigned by GitHub\n* `2025-06-26` Fix released in version 2.33.10\n\n## References ##\n\n* [Original Advisory](https://github.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-05_Filebrowser_Bypass_Command_Execution_Allowlist)\n\n## Credits ##\n\n* Mathias Tausig ([SBA Research](https://www.sba-research.org/))",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/filebrowser/filebrowser/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.33.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/filebrowser/filebrowser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.11.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/filebrowser/filebrowser/security/advisories/GHSA-w7qc-6grj-w7r8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-52995"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/filebrowser/filebrowser/commit/4d830f707fc4314741fd431e70c2ce50cd5a3108"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/filebrowser/filebrowser"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/filebrowser/filebrowser/releases/tag/v2.33.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-05_Filebrowser_Bypass_Command_Execution_Allowlist"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3795"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-30T17:46:22Z",
    "nvd_published_at" : "2025-06-30T20:15:25Z"
  }
}