Mozilla maintenance service discloses path with SYSTEM privilege
Categories
(Toolkit :: Application Update, defect, P3)
Tracking
()
People
(Reporter: xiaoyin.l, Unassigned)
Details
(Keywords: csectype-disclosure, sec-low)
Attachments
(1 file)
|
506 bytes,
application/octet-stream
|
Details |
A non-administrator Windows user (i.e. standard user) can trick the Mozilla maintenance service to disclose whether a specified directory exists with SYSTEM privilege. For example, a standard user has no access to any files and subdirectories of C:\Users\Administrator. With this trick, he can check if C:\Users\Administrator\AppData\Local\Google exists, but this information shouldn't be available to standard users.
The problem is in function ExecuteServiceCommand() in workmonitor.cpp.
if (argc < 5 || !IsValidFullPath(argv[5])) {
LOG_WARN(
("The install directory path is not valid for this application."));
#ifdef DISABLE_USER_IMPERSONATION
if (!WriteStatusFailure(argv[4], SERVICE_INVALID_INSTALL_DIR_PATH_ERROR,
userToken)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
#else
// No user token so we can't call
// WriteStatusFailure(argv[4], SERVICE_INVALID_INSTALL_DIR_PATH_ERROR)
#endif
return FALSE;
}
We first force IsValidFullPath(argv[5]) to be false, which is easy: as long as argv[5] contains ... DISABLE_USER_IMPERSONATION is defined in Release version of Firefox. So WriteStatusFailure() is executed. argv[4] is attacker controlled. argv[4] is a folder and has to end with "updates\0". We create a junction C:\tests\updates\0 which points to any folder we want to check for existence. If the folder exists, then WriteStatusFailure() succeeds and the warning "Could not write update.status for previous failure." is not logged. If the folder doesn't exist, then WriteStatusFailure() fails and the warning "Could not write update.status for previous failure." is logged. We can distinguish these two cases simply by reading the log at "C:\Program Files (x86)\Mozilla Maintenance Service\logs\maintenanceservice.log".
PoC is attached. Run mozilla-service-poc.bat C:\Users\Public\Desktop and mozilla-service-poc.bat C:\Users\Public\NXFolder. See the difference.
| Reporter | ||
Comment 1•7 years ago
|
||
Test environment: Windows 10 x64 Build 18362.239. Firefox 64-bit 68.0
Updated•7 years ago
|
Updated•7 years ago
|
| Reporter | ||
Comment 2•7 years ago
|
||
I recently realized that this is not a security vulnerability. The ability for standard users to check directories' existence isn't a security boundary.
Updated•6 years ago
|
Description
•