SUID Mount Helper has 5 Major Vulnerabilities
There are 5 separate vulnerabilities with the calibre SUID mount helper:
These vulnerabilities concern /src/calibre/
1. Ability to create root owned directory anywhere. The mount helper calls mkdir(argv, ...) on line 48.
2. Ability to remove any empty directory on the system. For example, line 172.
3. Ability to create and delete user_controlled
4. Ability to inject arguments into 'mount' being exec'd. On lines 78, 81, and 83, the final two arguments to mount are user controlled. On lines 1033, 106, 108, 139, and 141, the last argument to unmount/eject is user controlled. The "exists()" check can be subverted via race condition or by creating an existing file in the working directory with a filename equal to the desired injected argument.
5. Ability to execute any program as root. The mount helper makes use of execlp on lines 78, 81, 83, 103, 106, 108, 139, and 141, and the first argument does not start with a / character. Because of this, execlp will search PATH for the executable to run. PATH is user controlled, and thus it is trivial to write a program that spawns a shell and give it "mount" as a filename, and direct PATH to its directory. A proof of concept of this is attached.
|visibility:||private → public|
|Changed in calibre:|
|status:||Fix Released → Confirmed|
|Jason A. Donenfeld (zx2c4) wrote : Re: [Bug 885027] Re: SUID Mount Helper has 5 Major Vulnerabilities||#40|