Closed Bug 1565911 Opened 7 years ago Closed 7 years ago

Mozilla maintenance service discloses path with SYSTEM privilege

Categories

(Toolkit :: Application Update, defect, P3)

Desktop
Windows
defect

Tracking

()

RESOLVED INVALID

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.

Test environment: Windows 10 x64 Build 18362.239. Firefox 64-bit 68.0

Priority: -- → P3

I recently realized that this is not a security vulnerability. The ability for standard users to check directories' existence isn't a security boundary.

Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Group: firefox-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: