Critical Csrf To Rce In Filebrowser
The user creation endpoint accepted JSON data sent with a text/plain content type and did not validate the Origin header or use anti-CSRF tokens, so an attacker could make a logged-in admin's browser create a new admin user. That backdoor user could access the whole filesystem and, because admins can run commands, lead to remote command execution.
I used to pick random opensource software for my research, recently I took some web-based file management software as my research targets. There I found some popular web-based file managers, one of them was a software named “FileBrowser”.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server accepted JSON request bodies with a text/plain content type and did not validate the Origin header or require an anti-CSRF token, allowing cross-site form submissions to create users.
Impact
An attacker could create an admin user with access to the whole filesystem and, because admins can run commands, achieve remote command execution.
What the attacker needed
Victim is a logged-in admin; victim clicks a link or button; attacker can host a webpage
The fix
The vulnerability was fixed in version v2.18.0.
How it was found
- Start a FileBrowser instance.
- Host a malicious HTML page on a simple HTTP server.
- Send the page URL to a logged-in admin and get them to click the button.
- The page submits a POST request to the user creation endpoint, creating a backdoor admin user.
- Log in as the new user to access the filesystem.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you are logged in to a website, your browser automatically sends your session cookie with requests to that site. A cross-site request forgery (CSRF) attack tricks your browser into sending a request the site trusts, without you meaning to. Here the site did not check that the request really came from its own pages, so a malicious page could create a new admin account.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.