March 27th, 2018

The WMI root node is just a node in the WMI namespace

A security vulnerability report arrived that went roughly like this:

There is a serious zero-day security vulnerability in the WMIC.EXE program. It does not check whether the user has administrative privileges before granting access. Simply sign in as a standard user and run the wmic program. Observe from the prompt that it gives you root access.

C:\> del config.sys
Access is denied

C:\> wmic
wmic:root\cli> cdrom get description, drive
Description   Drive
CD-ROM Drive  D:

The WMIC prompt looks like this:

wmic:root\cli>

This is telling you that your current location (which WMI calls a role for some reason) is the cli node in the root of the WMI namespace. You can change this by typing

wmic:root\cli> /ROLE:..\cimv2
wmic:root\cimv2>

We suspect that the finder saw the word root and assumed it had the same meaning here as it does in Unix. In Windows, the administrator account is called Administrator, not root.

Their screen shot shows that they don’t have administrator privileges when they started (because they can’t delete the file C:\config.sys). From inside the WMIC tool, they printed information about the CD-ROM drives, but that operation doesn’t require administrator privileges, so that isn’t proof that any elevation occurred.

Running the WMIC program doesn’t change your security level. If you don’t have administrator privileges, then you still cannot do things like, say, delete system files.

wmic:root\cli>datafile where name="C:\\config.sys" delete
Delete '\\PC\ROOT\CIMV2:CIM_DataFile.Name="c:\\config.sys"' (Y/N/?)? y
Deleting instance \\PC\ROOT\CIMV2:CIM_DataFile.Name="c:\\config.sys"
ERROR:
Description = Access denied
Topics
Other

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.