Keybase advisory: Local Privilege Escalation on Linux via Keybase-Redirector
The Linux keybase-redirector binary ran with root privileges and launched the fusermount helper without an absolute path or a cleared environment. A local attacker could place a malicious executable named fusermount on their PATH and have it run as root.
keybase.io
Published on keybase.io
The Keybase file system redirector controls the /keybase mountpoint on Linux machines (and macOS machines that have enabled Finder integration). In order to support multiple users running Keybase on the same machine, both able to access the Keybase file system through /keybase paths, this mountpoint acts as a…
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 privileged binary executed a helper via a name lookup that honoured the caller's PATH and environment instead of using an absolute path or a clean environment.
Impact
A local user could run arbitrary code with root privileges; macOS was not affected because the binary lacks the suid bit there.
What the attacker needed
Local access to the machine; ability to run keybase-redirector
The fix
The PATH was restricted, then the redirector was hardened to use the Mount syscall directly and drop root privileges outside that call; users should upgrade to the fixed versions.
How it was found
- Place an executable named fusermount in a directory you control
- Add that directory to your PATH environment variable
- Run keybase-redirector so it executes your program with root permissions
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.
Some programs run with extra powers (root) so they can do privileged jobs. This one looked up a helper program by name using the user's search path instead of a fixed location, so a user could supply their own program with that name and it would run with those extra powers. That lets a normal user become the machine's administrator.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.