Phoenix said:
The exploit is actually two fold:
1) If you are an admin user (like most XP Home Edition users) then you are 'pre-owned'.
Agreed. If anything hostile gets on your system, you're screwed. There's nothing the OS can do to stop that if you insist on running as an admin.
2) If you aren't an admin user then ActiveX controls installed or RUNNING FROM the web can peep the settings. ActiveX controls (malware, worms, etc) running locally can actually change the status flags such that regular users would think their machine is secure when it isn't (this actually being the real issue in the exploit).
ActiveX controls running locally as ANY user can change the settings? I find that extremely hard to believe.
An ActiveX control is JUST a DLL that exports a couple COM interfaces. It's nothing special. If a non-admin regular EXE can't modify the WMI flags, why should an ActiveX control running as a non-admin be able to do it?
Actually they are different in some ways that aren't necessary to go into here - particularly if you've written them using C#.
C# who cares.
Managed code is just a wrapper around the real stuff underneath for people who dont understand or dont want to deal with it.
The basic way an ActiveX works is the same regardless of language.
You have a DLL that implements some standardized COM interfaces, and a DllRegisterServer() entry point that sticks a couple registry entries in the right places. When an app wants to use the ActiveX, it tells COM to create an instance of the interface. COM looks up the interface in the registry, loads DLL into memory, and calls DllGetClassObject() on that DLL, causing the object implementing the interface to be constructed. COM then returns the requested interface pointer to the app.
Unlike generally sanboxed browser plugins - well, on browsers than IE anyways, ActiveX plugins have the ability to execute arbitrary native code.
All regular browser plugins are written as native code, there is NO sandbox. There is no sandbox in mozilla for plugins. There is no sandbox in Firefox for plugins.
Go download Macromedia Flash for Mozilla. It's a regular DLL. Go download Quicktime. Native code. If these developers wanted, they can do anything on the machine you can. Pop dialogs, spawn processes, anything. The browser does NOTHING to stop them, because it cant.
I used to write OpenGL renderers in ActiveX so I'm well aware of how to get past the browsers security mechanisms using them. So yes, they can bypass security in so much as they can load up opengl32.dll toss a malloc'd 1024 byte vertex array into glDrawElements and buffer overflow the dll and bypass the security layer altogether.
There IS no security layer in the browser in a plugin. None. The browser doesnt even try to enforce one. You can LoadLibrary() on any DLL you want, call any function you want. You can do anything an EXE can. You dont need to buffer overflow anything to break out of the browser.
They can do this WITHOUT being admin. That's always been the problem with ActiveX controls, .Net, etc. If you're gong to allow me free native library access to a library on the machine OR one that I provide / I can root you till the end of time.
Browser plugins are exactly the same way.
The Flash plug-in has had a number of holes that could result in a remote exploit because of this, and a remote rooting, if you were running as a privileged user.
As a side point, .NET is different. .NET is a managed runtime like Java. You cannot freely access native libraries from a managed .NET class within the browser CLR without the correct permissions. If you have done any development with .NET CLR or managed code, youd know this.
Yes - and since it so obvious then the consequences are JUST as obvious. Sandbox all ActiveX controls and bar them from getting to the native system just like java applets.
There is no way to sandbox native code without creating a separate process running under a different primary token (like how Apache and IIS6.0 do it). Since both ActiveX controls and browser plugins are all loaded in-process and are all native code (this is true of all browsers, including Firefox, mozilla, Opera, and IE), there is no security model beyond what the OS provides at the browser process/user level.
ActiveX and Java applets are
two different things.
The analogue for an ActiveX is the browser plug-in. You write native code modules, which plug into the browser directly. There is no browser security model to speak of. You have to trust your browser plug-ins, just like you have to trust your ActiveX controls.
Like browser plug-ins, you are not supposed to install ActiveX controls very often. Like browser plus-ins, you tend to install a couple when you first start browsing (QuickTime, Flash, Acrobat, maybe RealPlayer or Java, etc), but after a while, its pretty rare that a website should legitimately ask for one to be installed.
UNLIKE browser plug-ins, ActiveX controls all have to be cryptographically signed, and this is verified by the browser before the plug-in is installed. The signature is intended to provide accountability and a guarantee that the installer package has not been tampered with since it was created.
UNLIKE browser plug-ins, ActiveX controls can be installed without exiting the browser, or running an external setup program. HOWEVER as of SP2, IE will first refuse to download the installer package automatically, until the user explicitly requests it by clicking on the information bar and clicking download. Then the user must explicitly click yes on the following "are you sure" dialog to allow IE to download the file, and finally, he must click yes one last time on the "signature verification" dialog to allow IE to unpack and install the control.
An analogue for .NET/Java applets would be Macromedia Flash .swf files. You write little applets, which execute in the context of a protected environment provided by a browser plug-in (the .NET CLR, Java VM, or the Flash plug-in).
Hence, making ActiveX into Java is a nonsensical proposition. Theyre two DIFFERENT technologies, intended for two DIFFERENT tasks. Apples and oranges.
Yes - I have a subscription to MSDN like every other decent I/T developer in the world
Thats like me asking you if you've ever written an ActiveX control. The ramifications of anything affecting the internet connectivity of Windows is generally well within my domain and responsibility for knowing.
Pop quiz:
What is a .MOF file?
What are three things an IT administrator might do with WMI?
Where is the WMI database actually stored?
Expedience and intent. If I intend to turn your machine into a spam relay - I want you to believe that your machine is fine and up-to-date at all times. I don't want to create a condition/environment that antivirus software would recognize.
If I have owned your machine to the point where I can install a spam relay onto your machine, I can shut up the security center with two commands:
sc stop wscsvc
sc config wscsvc start= disabled
I dont need to screw around with WMI.
Frankly if the machine is that owned, Id just install a rootkit, and not even your antivirus will catch me then.
The whole WMI thing is a red herring. If the machine is owned to the point I can do stuff to WMI, I don't need WMI to do far worse stuff.
WMI isn't really a mechanism for accessing OS services
It sure is a way to access OS services.
POP QUIZ:
What is a WMI provider, and why would I want to write one?
What it is however is a way to deceive users and to make the security center meritless for the user because while they think their machine is fine - it isn't...
Thats like saying a web browser is just a delivery mechanism for exploits.
it is a compromised box. The security center must absolutely and at all times be running, be secure, and have its internal data encrypted (for goodness sakes) so that a user can know the condition of the machine.
I could just stop the security center, and put in my own fake security center app.
The security center UI is just an application that displays a dialog and some pop-up balloons. It runs in your user context with no special permissions.
It is a useful advisor to the state of an uncompromised system: you can get all your notifications in one place, as opposed to three different apps.
If a machine has been compromised, if you've been running as admin, all bets are off.
If you haven't been running as admin, the state of WMI hasn't been corrupted anyway, so the security center "spoof" is irrelevent.
There is a different in the Unix domain between having administrative rights and having root access. The way Windows currently handles permissions (and hopefully this is fixed in Longhorn), admins are the equivalent of root users - which is an incorrect behavior.
Semantics. Admins are always root users.
What Windows should be doing is forcing everyone to log-in as regular users.
Regular users should have the ability to elevate themselves to admin for specific tasks by authenticating themselves to the system again.
Wait, that's what you can do today (except for the "force" part). OMGWTF.
The rights granularities for home users of XP isn't granular enough which is the reason why XP Home installs in default as Administrator in the first place (according to a WinHEC almost 5 years ago). There are many things (like installing software) that the Home user would want to do that because of the funky access layer really belong to Windows admins under the NT kernal and NTFS.
The XP security model is plenty granular enough. Have you ever actually taken a look at it? (Please, ignore the dumbed down UI pasted on top of it in Home Edition.)
What are not granular enough are the rights that apps request in order to run properly.
This is not something MS can change with a service pack.
The difference being one of accessibility/usability. If my Mom (if she ever really started using computers) tried to do something on the Mac that required a priviledge elevation, it would ask her for a password. If your mom did similar on Windows, the operation would fail and tell her she didn't have Administrator priviledges. From a usability perspective they are very different from each other.
Good point, though superficial.
Given a quick explanation, theyll learn the correct response is to try Run As
if theyre sure they want to do what theyre trying to do (which shouldnt be that often to begin with).
Like I said above, the main point is XP unfortunately has no formalized notion of a "special user that can elevate privileges by authenticating to the system", and yes this is a deficiency, though you can substitue a regular user with "Run As..." to get close.
Further improving this is not something that could be done in a service pack IMHO, and not without breaking tons more apps then SP2 broke already.
But if you're going to leave the system in an immediately exploitable state - who are you doing a favor?
It sucks, but people really dont want to remember passwords.
BTW, the system does its best to prevent people that insist on having password-less accounts from screwing the system. The policy for XP Home is that all accounts with no passwords cannot be used for inbound network access. IE, you cant connect to an XP Home machine over the network with an account that has no password, you can only do a local console logon with such an account.
Frankly I think the only real solution to the whole logon problem is some sort of biometric/smartcard id and some sort of mnemonic PIN.
Example: Put your thumb here, and click the 3 photos out of 20 on the screen that you recognize as your pass-code. (Ex: a dog, my friend Joe, an airplane).