Coding Around UAC's Security Limitations 334
Mariam writes "Free software developers from the non-profit NeoSmart Technologies have published a report detailing their experience with coding around Windows Vista's UAC limitations, including the steps they took to make their software perform system actions without requiring admin approval or UAC elevation. Their conclusion? That Windows Vista's improved security model is nothing more than a series of obstacles that in reality only make it more difficult for honest ISVs to publish working code and not actually providing any true protection from malware authors. Quoting from the post: 'Perhaps most importantly though, is the fact that Windows Vista's newly-implemented security limitations are artificial at best, easy to code around, and only there to give the impression of security. Any program that UAC blocks from starting up "for good security reasons" can be coded to work around these limitations with (relative) ease. The "architectural redesign" of Vista's security framework isn't so much a rebuilt system as much as it is a makeover, intended to give the false impression of a more secure OS.'"
Where have I heard this before? (Score:4, Insightful)
Sounds like it was written by Homeland Security and the TSA.
Re:Where have I heard this before? (Score:5, Insightful)
The so-called work-around described in TFA:
Gee, sounds to me like UAC is working exactly the way it should!
Re:Where have I heard this before? (Score:5, Funny)
Gee, sounds to me like UAC is working exactly the way it should!
Re: (Score:2, Insightful)
But the design is flawed. The idea was that user interaction shouldn't be able to autostart a program which is able to modify system functions. But it is sufficient to have an autostart program remote control another autostart program to get exactly this behaviour.
Re:Where have I heard this before? (Score:5, Informative)
Re:Where have I heard this before? (Score:5, Insightful)
-The base filtering engine used by the Windows Firewall
-Computer Browser keeps track of other computers on the network
-Plug and Play
-Print spooler
-Event log
-Task scheduler
-Firewall
If these things didn't autorun, I'd have a pretty different system. That or everything would run as an administrator and we'd be right back to Windows XP with the same problems we had before.
Re: (Score:3, Insightful)
What problems? I run a network of about 80 XP machines. They all run fairly well--aside from the occasional failed Windows Update. Recently someone introduced a Vista laptop to the network. It can't print because the print spooler constantly crashes (with all 5 of the variety of printers on the network), if you plug it in to the network at one site it flat out refuses to talk to anything--even after trying for 45 minutes to get
Re: (Score:2)
Re: (Score:3, Insightful)
The author of the article basically lauds XP's "everybody runs as an administrator" scenario as if it was a good thing, then goes on to complain that Microsoft forcing him to play by their rules rather than by his own is somehow a bad thing.
In other words, system h
Re: (Score:2)
Re:Where have I heard this before? (Score:4, Interesting)
Other than that, the IPC primitives Win32 provides (message queues, pipes, etc.) are about the same complexity than UNIX's and really shouldn't take that much code.
Re: (Score:3, Interesting)
Doing something sloppy and wrong is often easier and less time consuming than doing things right.
This article is just that case.
NeoSmart was getting a free ride by being bad developers, and assuming that everyone was running as admin, and that someone would always be logged into the box.
Now they're being forced to learn how to program correctly, and do things right, and yep, it takes more lines of code.
Doing things the right way almost always
Re: (Score:3, Insightful)
Any installer can stick a service in there that does privileged tasks, and that means UAC is a thin layer that's easy to work around.
Re: (Score:3, Insightful)
Except nearly all installers use admin privileges, because the Program Files directory (to name just one) isn't per-user. Windows really isn't structurally designed for per-user installation, although MS have tried it's still half finished. Users know this, and always click yes on installers when prompted.
So it's just like /bin, /usr/bin and /Applications, then ?
Any installer can stick a service in there that does privileged tasks, and that means UAC is a thin layer that's easy to work around.
How is th
Re: (Score:3, Interesting)
In fact 99% of applications shouldn't need an installer for OS X. Just a drag to the
MSFT has turned a single user OS and tacked on multi user support, and then multi user security. OS X, and every *nix are Multi-user OS's. I not only have applications but also user specific applications
Re: (Score:2)
Re:Where have I heard this before? (Score:4, Insightful)
well /Applications is for everyone. your supposed to install it there. Any where else and your app is misbehaving anyways.
Exactly. Just like %PROGRAMFILES%.
MSFT has turned a single user OS and tacked on multi user support, and then multi user security. OS X, and every *nix are Multi-user OS's.
False. Windows NT is, and always has been, a multiuser OS.
I not only have applications but also user specific applications stuff that only I can run, and stuff that only I can see.
And you can do exactly the same in Windows.
You shouldn't have to be an admin to install a web browser, word processor , or spreadsheet. You should only be an admin if your installing it for everyone.
So, just like Windows then ?
Re:Where have I heard this before? (Score:5, Insightful)
False. Windows NT is, and always has been, a multiuser OS.
I've long thought that the single vs multi-user nature of Windows NT and Unix has more to do with user expectations than technical limitations.
Unix users were brought up on multi-user envoronments. root had to do stuff like install system-wide apps, printers etc.
Users never expected to be able to do this, and aplications developers coded knowing these limitations.
Windows users, on the other hand, evolved out of DOS users (please note that I'm talking about users not the underlying codebase). DOS users have always had unrestricted access to their system, and this expectation was inherited by modern-day Windows users.
Equally importantly, application programmers did not code with these limitations in mind.
What you end up with is a platform that's technically perfectly capable of being multi-user, but hamstrung by user expecteations and badly designed applicaitions.
Re:Where have I heard this before? (Score:5, Insightful)
If Microsoft had indeed taken the NT kernel and built a sensible operating system above it, it would have been a multiuser system, but they didn't. Instead, they took the entire DOS and Windows 3.x world and put the NT kernel underneath it. Technically speaking, they rather tacked a single-user mindset and framework on top a multiuser kernel, making a single-user operating system. Since the NT kernel basically was written to supplant Windows anyway, it isn't entirely biased to argue that multiuser support was tacked onto Windows.
Of course, I am still not arguing against the NT kernel. Microsoft could just as well have done the same thing with the Linux kernel as well, and the result would have sucked as badly. In fact, I don't know very much about the NT kernel internals (since the documentation isn't quite as easy to get at as it is in Unix), but I would guess that it isn't an entirely bad idea at an operating system kernel. Unfortunately, the kernel alone doesn't make an operating system, and Microsoft decided to build a basically single-user system on top of the kernel.
Re:Where have I heard this before? (Score:4, Insightful)
A number of applications do this by default and will complain or
just plain bail out if you try to install them as root.
Also, something like
users can create new directories in it but not necessarily stomp
on each other.
On other platforms, services tend to not be installed as superuser.
The fact that none of this occurs to you just shows how ingrained
the whole "run everything root" idea is in Windows user culture.
Re: (Score:2)
Re:Where have I heard this before? (Score:4, Informative)
2. The part in your link that nicely sums up NSA's contributions:
The NSA also declined to be specific but said it used two groups -- a "red team" and a "blue team" -- to test Vista's security. The red team, for instance, posed as "the determined, technically competent adversary" to disrupt, corrupt or steal information. "They pretend to be bad guys," Sager said. The blue team helped Defense Department system administrators with Vista's configuration.
I can't see anything wrong with that...
Re: (Score:2)
Re: (Score:3, Insightful)
A Service... (Score:5, Informative)
Gee, sounds like a daemon that can be controlled from an application to me.
Re:A Service... (Score:5, Informative)
Unfortunately, tying the desktop environment, window manager, and kernel together into a tightly integrated package will increase the damage per amount of attack vector surface area, should a single link in the armor be broken. In Windows, you've only got about 3 accounts, Local System, Network Service, and Everyone group. If a single service gets owned, it's running rogue at the same level of permissions, system wide, as root. Regardless if it's a crappy HP driver service, a hypervisor, or explorer. All that to say, the design is flawed such that not only are these things possible, but they have greater consequences than they would under other OSes.
Re: (Score:2)
That's probably why *nix'es are very, very specific about separation of concerns and granting the least possible permissions to a limited service account.
How exactly are *nix
Re: (Score:2)
OK, a lot of this reply is over my head about Windows internals, but popping open my services list on a fairly vanilla XPx64 install, damn near everything runs as localsystem, except for a few network-related services.
Re: (Score:2)
If you see someone running a database server or an email server as LocalSystem, then they should be "talked to", this is bad p
Re:A Service... (Score:5, Interesting)
Re: (Score:2)
The message pump is simply carries two arbitrary 32-bit payloads. If one of those happens to be a callback, so be it. The message pump is not is charge of stopping the kernel component from calling the code that the callback references, the Windows memory model does that. Since Windows 95 and since the conception of Windows NT, the kernel component would have to specifically map memory from the application's address space to call it, this couldn't be used as a code injection vector.
I was referring to a Shatter attack [wikipedia.org]. Although I don't know the least bit about it to speak with any kind of authority whatsoever, so it may be a non-issue.
That's probably why *nix'es are very, very specific about separation of concerns and granting the least possible permissions to a limited service account.
How exactly are *nix'es very, very specific about least priveliges? Admins are taught this, major packages in big distributions follow this rule. But, *nix'es don't enforce it, they only suggest it in the documentation. Any user that runs a personal *nix desktop that they installed themselves is not going to do it right. UAC was Microsoft's attempt to enforce good behaviors for people who don't know any better. Of course it was only partially successful because it is impossible to force people not to compromise their own systems.
I meant that the file system hierarchy is split up in such a way that it makes running services with limited credentials easier (i.e. chroot), the UIDs and GIDs are specifically marked such that the first 100 are reserved for services (although, as you pointed out, that doesn't mean that people will follow this convention, but it is explicit, nonethel
Re: (Score:3, Insightful)
Re: (Score:2)
They haven't proved anything. The UAC interaction was at the point of installaiton in this case. Once the user agrees to that, they are 0wned.
Film at 11 (Score:5, Funny)
Some clever programmers found a way to force a Vista PC to obey a user with admin rights.
I'm sure there will be a patch to fix this glaring security hole in the next batch of updates.
Much as I like seeing Microsoft humbled... (Score:5, Insightful)
Re: (Score:2, Insightful)
Re: (Score:3, Insightful)
Re:Much as I like seeing Microsoft humbled... (Score:5, Insightful)
Really? I've worked for over a dozen software companies in my career and the only two that didn't have more people in sales and marketing than in engineering and product development are also the only two that are out of business.
There are exceptions, I'm sure, but I think it's pretty normal that it takes more salespeople to sell a product than it takes engineers to design it.
Re: (Score:2)
Re: (Score:2)
The article does make a mountain out of a molehill. While not the most eligant, UAC worked as intended and for that matter in a valid way.
It's too bad that MS doesn't support the suid bit or capabilities and something like setuid (or seteuid). For one, it would make things like this simplicity itself.
More importantly, it would allow an admin to properly support users without knowing their passwords and allow simple programs to handle any odd corner cases.
After all these years, it would still seem that
Uhm, no not really a UAC work-around ... (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
As far as IPC? Use RPC. It's really not that hard.
Easy, but it's Not, but it is? (Score:5, Insightful)
This is the problem with Blogs. It looks like journalism, but it isn't.
Re: (Score:3, Insightful)
Re: (Score:2)
"This is the problem with television news. It looks like journalism, but it isn't", which I think is your point.
It still doesn't make blogs any better, though.
Re: (Score:2)
The biggest challenge to writing a service is authenticating the client. To make it really easy, let an existing component do that for you. Just create a C# component that will be invoked via remoting and is hosted in IIS, or create a COM+ Serviced Component. Both can be created in seconds simply by inheriting from the correct class in
A terrible idea. (Score:2)
On the plus side, it's another reason for customers to buy the next version of your software...
Hmmmm, would a ISV make more money overall by deliberatly NOT being forwards compatible? are some intentionally breaking the bounds of the published SDK for this reason?
Re: (Score:3, Insightful)
The NeoSmart folks just were being lazy and assuming everyone was an admin, and that someone was always logged into the OS.
UAC is shite (Score:2, Insightful)
Re: (Score:2)
Or that you are using really old software. Visual Studio has been updated twice since then. VS2005, and VS2008. Guess what, VS2008 doesn't require that you run as administrator. And even VS2005 only recommends it, because its required for a few features.
As for it being a design flaw of UAC/Vista... Tell me... are you able to do C++ development as a
Re: (Score:2, Redundant)
A privileged service is not a "hack." (Score:5, Insightful)
How is this a "hack"?
Perhaps the author of iReboot didn't see the rational for isolating a piece of code that needs to do something privileged and having it install and run in a user account which has sufficient permissions to allow it to run--but from a security standpoint this is no different than in Linux, where privileged code runs in a separate account from the user, and where IPC is used to communicate with that process.
Re:A privileged service is not a "hack." (Score:5, Informative)
In fact the first response where it was announced is:
Uhh... I'm running an admin application on startup automatically all the time, there's no need to create a service or anything. Just use the Task Scheduler to start the application, Trigger=At log on; And select "Run with highest privileges".
MS had NEVER set out to prevent elevated applications from running at startup.
Re: (Score:2)
So he created a service that runs with the necessary privileges to do what it needs, which communicates with a non-privileged front-end, and which requires privileges to install.
Indeed! That's exactly how it's supposed to work.
It's also what Steam did when they ported their client to Vista - the privileged parts (presumably code that decrypts game files or mucks about with your .gcf's in the program files directory) are installed as "Steam Client Service." After an admin installs it (with UAC prompt
In fact (Score:2)
The right answer, and the answer t
Re: (Score:3, Informative)
No, because MSI runs privileged and is able to install such processes at the command of normal users - that's the hole. You get one prompt, at installation time.. but I've never seen a windows installer that *didn't* prompt for elevation. Contrast with Unix based systems where installing apps as a normal user is the norm and installing as root is an exception (indeed with OSX each user ha
Re: (Score:3, Insightful)
No, because MSI runs privileged and is able to install such processes at the command of normal users - that's the hole. You get one prompt, at installation time.. but I've never seen a windows installer that *didn't* prompt for elevation.
Nothing to do with the OS, everything to do with the application developer.
Contrast with Unix based systems where installing apps as a normal user is the norm and installing as root is an exception (indeed with OSX each user has a full set of directories for this by de
Re: (Score:2)
Re: (Score:2)
Contrast with Unix based systems where installing apps as a normal user is the norm and installing as root is an exception (indeed with OSX each user has a full set of directories for this by default, and it's rare for something to require elevation.. when it does you definately think because it's unusual).
Wow..that's crazy! Using FreeBSD/OpenBSD I pretty much always elevate to root / use sudo to install applications or make system config changes (/etc). On OSX, I would say MOST installers require you to elevate. Apps that you install with drag+drop of course don't need elevation.
OSX actually does require you to type your password to elevate fairly often! The main difference, imho, between Vista and OSX is the Vista interface SUCKS, and you get asked to elevate MULTIPLE times during the same process. In OSX,
Re: (Score:2)
Re: (Score:2)
i'M not
Re:A privileged service is not a "hack." (Score:5, Informative)
If I write a service that allows any user to write to any location in the filesystem (entirely possible on any OS - for Windows, I install a LocalSystem service, for *nix, I install a daemon that runs as root) then that service has a security hole in it, and it can be used to elevate privileges from normal user to admin/root.
That's a flaw in the service/daemon, not a flaw in the OS.
Unless you were saying that you don't know if this app has a security flaw like the one I described above.
Re: (Score:2, Funny)
Re: (Score:2)
It's fun to be on the bandwagon though, huh?
Re: (Score:2)
This certainly fits with my experience (Score:2, Redundant)
The problem was that we wanted the page to refresh after the upload was complete. This seems like it should be fairly simple, but with how the security works, there's not a simple way to
Re: (Score:2)
Re: (Score:2)
Flash code is maintained compatible by all the browsers running the same flash engine, which Adobe has a vested interest in keeping compatible across architectures. Sounds like a good opportunity for me to write a piece of code once and only once, which I'd jump at.
Re:This certainly fits with my experience (Score:4, Informative)
More fud (Score:5, Insightful)
Re: (Score:2)
Not entirely true. Anyone on Vista with administrator privileges can install that application. If the user does not have administrator rights on the machine, he or she will be see a password prompt for a proper admin account.
Anyone with root privileges (via sudo) on OS X or Unix can do the same thing.
Re: (Score:2)
Re: (Score:2)
Except that on Vista *anyone* can install that application. On Unix you would need the root password to do such a thing.
False. Not on all, but certainly the majority of UNIX systems in use today.
Misleading Summary (Score:5, Interesting)
I fail to see how they drew this conclusion:
"[UAC does] not actually providing any true protection from malware authors"
This isn't a hole in the system. If applications couldn't use services running at admin or system then the entire system would be damn near nonfunctional.
I mean how would you even play music without a regular application being able to communicate up safely to the driver?
The article is fine. The person who wrote the summary didn't actually RTFA and is just trolling. They haven't justified anything they've said.
Re: (Score:2)
Side note: if you do assume that any privileged transaction should require a user prompt then surely allowing services to do admin stuff without prompting the user every time is a flaw.
To be perfectly honest, (Score:2)
It's a lot easier to make an isolated service with rigidly defined IPC secure than it is to make something that interacts directly with the user secure.
But maybe it's all that unix poisoning my brain.
Re: (Score:2)
The problem simply is that the old registry keys for autostart have no way of specifying whether the started program should be elevated. Automatically (silently) elevating all autostart programs is a bad idea (non-elevated code can add autostart programs), and showing an elevation prompt pop up after every login is also a bad idea (I need to confirm a UAC prompt to login?). So Microsoft ended up with that "autostart program was blocked" solution. It's not a good idea, but it's less bad than the alternatives. But there was no intention of blocking programs from starting silently elevated, provided they are registered for autostart somewhere were only admins have access and where elevation can be explicitly controlled (because silently elevating just because some program says so is a bad idea). This is not possible with the Run registry key, but it's possible with the task scheduler.
Sure, the task scheduler is a service, but the tasks it starts run in the user's session, so they can display UI. There's no need to write a custom service and use inter-process communication between a non-elevated UI and a service.
This is not Vistas fault. It's just that the programmer did not know how to do it the windows way and ended up writing something insanely complicated to do the job, when something really simple would have been sufficient. Now he knows how to do it right, and in the next version he can use the scheduler to start his program, and trash all the service-fronte
if len(IPC) >= 8 * len(business_logic) (Score:2)
It's a lot easier to make an isolated service with rigidly defined IPC secure than it is to make something that interacts directly with the user secure.
But it's also a pain in the behind when your platform's IPC APIs are so byzantine that the code for the IPC is an order of magnitude bigger than the code for the business logic. I can't provide a direct quote from the article as I type this because "The connection to the server was reset while the page was loading", but I do remember it going from 100 lines to 1200.
Weird logical disconnect in the article (Score:5, Informative)
The "Gory details" portion of the article gives a pretty good explanation of the work they had to do to make iReboot access high-permission OS features via a low-permission client. I have no idea how they got from there to "Any program that UAC blocks from starting up 'for good security reasons' can be coded to work around these limitations with (relative) ease." What they seem to be missing is that there was an installer in the loop---an installer that requires admin privileges. This is exactly the part of the process that UAC is trying to force upon Windows developers!
The most significant problems with the Windows XP security model are as much social as technical. Because the model didn't make it easy to get "serious work" done as a non-administrator, most people are running as administrators most of the time. This creates a whole culture that is very vulnerable to social engineering---simple games are being run at the same permission level as complex drive-recovery utilities and keyboard loggers.
By having people run low-privilege by default and escalating when necessary, the UAC model forces developers to be a little clearer about what their applications are doing (since things that "just worked" in WinXP now require permission in Vista). My understanding is that the way iReboot works now is the way it should always have worked, under the Windows OS model; the fact that it also worked if the user were running as an administrator was a happy accident. How well did the old iReboot work if I wasn't running as an administrator? If the answer is "It didn't," then, well, maybe they were doing it wrong the whole time.
UAC has some problems, but the fact that it puts more work on developers isn't one of them. The work is necessary because it is accounting for a weaker security model from the past. And developers should know that security isn't free.
Re: (Score:2)
The most significant problems with the Windows XP security model are as much social as technical. Because the model didn't make it easy to get "serious work" done as a non-administrator, most people are running as administrators most of the time. This creates a whole culture that is very vulnerable to social engineering---simple games are being run at the same permission level as complex drive-recovery utilities and keyboard loggers.
There is _nothing_ in Windows's "security model" that requires - or even
Re: (Score:2)
Re:Weird logical disconnect in the article (Score:4, Informative)
Re: (Score:3, Informative)
When I said "model," I was referring to the aggregate of the actual model and the way the model is exposed for the average consumer (who in WindowsXP, is usually running as an administrator for even the simplest tasks, either due to poorly-written software or their account simply having been configured by default as an administrator). There is just too much software in Windows XP that wants administrator privileges for questionable reasons---so much th
Re:Weird logical disconnect in the article (Score:4, Insightful)
There is _nothing_ in Windows's "security model" that requires - or even encourages - this. The problem of apps needlessly requiring Administrator-level privileges is 100% the fault of the developers of said apps and has been for nigh-on a decade.
Ironically Microsoft themselves have a proud history of producing such apps...
There's nothing "weak" about Windows NT's security model. Never has been. There were, arguably, weaknesses in the *default configuration in some environments*,
I agree, only I'd change *default configuration in some environments* to out-of-the-box defaults which are unchanged in most environments.
Re: (Score:2)
Other purpose of UAC (Score:2)
Re: (Score:2)
I agree. A few months ago I had a small and simple program which I really wanted to be able to run in a 'setuid' kind of way, and I discovered that I simply couldn't because under the UAC model Microsoft doesn't allow this. It was annoying at the time since I was already planning to separate the admin program I'd written from everything else. Instead I'd have to run the admin program as a se
"got around", yeah, right. (Score:2)
Re: (Score:2)
Reading this reminded me of this... (Score:2)
The big take away here is that this is not a security hole in any sense of the word. In order for a malware author to exploit this they would first have to get the user to install a service on the machine. If you can get the user to install random software, why bother with any other steps? You've already compromised the machine. I mean if your "security hack" involves the step "Get user to install malicious software", then you don't have a sec
Wait a minute.... (Score:2)
What a load of bollocks (Score:2)
But then later they say
UAC? (Score:2)
I think you can BUY your way out too. (Score:2)
I don't think the certificate lasts more than a year at a time either. Anyone writing free utilities that need privs isnt' going to want to spend several hundred $ a year to "certify" their sw...
Re: (Score:2)
Instead signing the binary changes the prompt to say that the program is at least from a verified publisher... but still leaves it to you to decide if you want to elevate or not.
For more info on the kinds of UAC prompts that exists see: http://windowsvistablog.com/blogs/windowsvista/archive/2007/01/25/accessible-uac-prompts.aspx [windowsvistablog.com]
Lies and FUD... (Score:2, Informative)
From TFA: "Microsoft can claim that Vista blocks system-modif
Re: (Score:3, Funny)
Re: (Score:3, Insightful)
Re: (Score:3, Interesting)