Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Security Operating Systems Software Windows

Vista's Troublesome UAC is Developer's Fault? 228

MythMoth wonders: "We've heard all about the pain and discomfort of working with Windows' User Account Control (UAC) switched on, but now Ian Griffiths is explaining that the developers are the problem — they brought it on themselves. In earlier articles we have heard that Microsoft think that everyone should do it like this — Ian does acknowledge that things are better in the Unix world, but is he right? Is the onus now on the developers to help fix a problem that they did not cause?" Rather than ask the user for permission on every operation, what other ways could Microsoft have improved Vista's security?
This discussion has been archived. No new comments can be posted.

Vista's Troublesome UAC is Developer's Fault?

Comments Filter:
  • by 280Z28 ( 896335 ) on Thursday May 10, 2007 @02:04AM (#19063405) Homepage
    I noticed a different and (possibly) serious issue:
    • First few times: What is this annoying thing?
    • Next few times: Well I guess it's better than not knowing
    • After that (without reading) click ok...
    So does that mean it's not working, wasting my time, AND training me to ignore security warnings? Honestly I don't have a better solution except for the rhetorical question "why can't people who exploit users just /themselves......"
    • by Osty ( 16825 ) on Thursday May 10, 2007 @02:12AM (#19063455)

      So does that mean it's not working, wasting my time, AND training me to ignore security warnings? Honestly I don't have a better solution except for the rhetorical question "why can't people who exploit users just /themselves......"

      Which goes to exactly what Ian was saying -- If you're really seeing UAC that often, you're doing something wrong (or you're using software from developers who did something wrong). As developers get their act together and stop requiring admin privileges for trivial things (hint: using %userprofile% and HKCU rather than %programfiles% and HKLM will solve 90% of your admin-privilege requirements when developing), UAC prompts should appear less and less often, and then only when you really expect them (you're doing system configuration stuff) or when there's a real issue that you should deny. Unfortunately, that world is probably 3+ years away as developers get with the program and rev their software, and in the meantime UAC will just become one more annoying dialog you have to click through to do anything.

      With that said, I saw the UAC dialog exactly once today, and that was only because I had to upgrade my video drivers. I'm a professional software developer. I spend my time with Visual Studio and SQL Server, and I rarely have to deal with UAC prompts.

      • Re: (Score:2, Interesting)

        by 280Z28 ( 896335 )
        It will be interesting to see if developers actually pay attention. Just think about how many poor programming practices you see today*. Books have been out for 10 years about good coding... UAC is but 1 year old. I hope we're not in for the long haul, and yet I know we are...


        * Today I ran across a stack class that used for its push function... an overloaded operator new...
      • by pallmall1 ( 882819 ) on Thursday May 10, 2007 @02:32AM (#19063575)

        I spend my time with Visual Studio...
        So have you followed Microsoft's advice to "run Visual Studio 2005 elevated"?

        Who is a developer supposed to listen to -- Microsoft or Ian Griffiths? It seems to me that Griffiths has a lot of nerve blaming developers for following Microsoft's recommendations.
        • by AaronBrethorst ( 860210 ) on Thursday May 10, 2007 @03:43AM (#19063933) Homepage
          VS2005 does not require you to run with admin privileges. There are some scenarios that require this, but they're generally the exception rather than the rule. If you want to do something like create a new IIS website on your local machine from within VS you'll need to launch VS elevated, but this is because IIS requires administrative privileges to accomplish this task. For VS 2005, there wasn't much we could do about that. Let me know if you want more information about the topic. I was the developer division's go-to guy for UAC for a year.
          • by pla ( 258480 )
            VS2005 does not require you to run with admin privileges.

            If attaching to a process to debug it doesn't require admin privileges, Vista has a lot more wrong with it than the annoying UAC giving false positives...



            There are some scenarios that require this, but they're generally the exception rather than the rule.

            Debugging most certainly does not count as an exception to the norm. If you need to work with someone else's code, walking through it a few times with a debugger will teach you more in one d
            • Re: (Score:3, Insightful)

              by cerberusss ( 660701 )

              If attaching to a process to debug it doesn't require admin privileges, Vista has a lot more wrong with it than the annoying UAC giving false positives...
              I only code on Linux, however, I don't think you need admin priv to debug a process that runs with your own user's privileges??
              • Exactly. Go ahead and run gdb on a process that you own. Notice that you don't need to be root. I fail to see what the security hole is here.
                • by tepples ( 727027 )

                  Go ahead and run gdb on a process that you own. Notice that you don't need to be root. I fail to see what the security hole is here.
                  Would you want some piece of third-party proprietary software to be able to attach gdb to your web browser and hit a breakpoint whenever the user is entering a name and password?
                  • Most desktop users on Unix only run a few proprietary applications at most: maybe a couple of Windows games (via Cedega or Wine), Opera, and video drivers. Windows games probably won't be able to use gdb on your Unix system; Opera actually is your web browser, so it doesn't need to attach gdb to itself to find your password; and the video drivers are running higher than root.

                    Of course, you could use SELinux and its application roles. That might help.
                  • Re: (Score:3, Insightful)

                    by profplump ( 309017 )
                    User-privilege-based security is not intended to protect information a user controlls from processes the same user controlls, and can't even if you don't allow debugging. If you don't want your processes to know anything about each other you shouldn't run them as the same user.

                    Beside that, running a debugger is also far from the easiest way to get someone's passwords if you have the ability to launch programs.
            • by Rycross ( 836649 )
              I haven't checked whether this is the case on Vista or not (since I run 2k5 in admin mode), but XP definitely did not allow debuggers to be attached to processes in user modes. There is a specific option to enable user-mode debugging in XP. Vista may be the same.
        • It seems to me that Griffiths has a lot of nerve blaming developers for following Microsoft's recommendations.

          Heh. And Ubuntu users have a lot of nerve blaming me for following the install CD's HIGH RECOMMENDATION to install grub on the MBR.
      • Except that using HKCU has another problem: many programs register stuff they need in the registry. On a single-user system HKCU isn't a problem. But when another user tries to use that installed program, BAM, none of the required registry entries are in their HKCU tree. Which means developers have to develop another set of practices as well: either writing programs that can self-register themselves and set up all the neccesary registry entries on their own independently of the installer (at which point the

        • Re: (Score:3, Interesting)

          by badfish99 ( 826052 )
          Surely the reason that Window developers haven't learned from the rest of the universe is Microsoft's fault. Microsoft have done everything thay can to make Windows development an entirely self-contained and proprietory process: you use Microsoft's IDE, write your code in Microsoft's unique language or (if you use C++) using Microsoft's unique proprietory API. You never learn, because you never have to think; you just go along with what Microsoft tell you to do, without ever having to understand it. Microso
          • by fwarren ( 579763 ) on Thursday May 10, 2007 @06:04AM (#19064609) Homepage
            Take a look at what we call "good programming practices" in the Windows world. Look at the windows programming bibles. Look at how many programs written by Microsoft that are not designed to be administrative programs break on Vista.

            That's not fair, to expect Office 97 to run fine on Vista. Well actually it is. If you had followed all of Microsoft's best practices, and work the platform as designed....you end up right where we are at today.

            Were Microsoft programs ever written to be run as a low privileged user working only with the users folder in "Documents and Settings" and only writing to HKCU. With the installer designed to be run once as an Administrator to write files to "Program Files" and HKLM?

            Yes, you could always run a low privileged account and change permissions on certain registry keys. But face it, these are a hack. Until recently, Microsoft never wrote software that way. They never seriously advocated it either. If they did, professional software such as Quickbooks 2001 or 2005 would run just fine on Vista.

            Hell, the whole registry thing was a bad idea. In the Linux world, when you move to a new box, you can copy an rc file or folder from /etc and your rc file from your home directory and the program is configured to run properly on the new machine. Bash_rc for example. Most well behaved programs make few if any changes to other programs rc files. Very few of those even need any files from /etc, usually just one file or folder from your user directory is enough.

            Most of the time in Windows you can not even copy out the relevant section from HKLM and HKCU because of the shoddy programing practices as taught and evangelized by Microsoft. So many entries in the registry are spread out over so many places, the program won't run if you copy just one section from the registry. A good example is Outlook Express. You cant just copy out "Outlook Express" keys from HKCU and the data files and expect it to run.

            If I had to point my finger at developers for bad practices. I will be pointing my finger towards Redmond Washington.

            • by nschubach ( 922175 ) on Thursday May 10, 2007 @08:19AM (#19065401) Journal
              That's why I've always said and stick by my thought that programs should only have access to the directory in which they run. All settings and program specific files should be contained within said directory and children and not be given permission by default to access anything in or preceding their parent scope. This should be enforced by the OS, save for one aspect which is easily controlled. Save or open common dialogs grant "sudo" access to whatever file the user selects outside that scope. Operating system maintenance programs would be the only other "special" programs and installing them should prompt the user with very stern dialogs with a system stability warning.
      • by DrYak ( 748999 ) on Thursday May 10, 2007 @07:08AM (#19064929) Homepage
        Waiting passively for the programmers to change their bad habits isn't the best strategy that could have be taken by microsoft.

        As you state those problems stems from bad programming habits. Developers that have taken the habit of writing critical data just like in the old DOS days : wherever it pleases them, ignoring the fact that some place are supposed to be reserved for admins only.
        It has worked up to WinXP because either there wasn't any protection (older DOS based Windowses) or all users did run as admins by default (newer NT based Windowses). Now that VISTA finally tries to correct this and approach something that looks like Unix' habits - using admin-level privileges for doing ... admin work on the machine as intended. They found thousands of bad-behaving softwares that can work under this envrionment.

        BUT THEY'VE TAKEN THE WRONG ROUTE AROUND THE PROBLEM !!!

        With such problems you have three solutions :

        - IGNORE THEM. Let the bad-behaving software just crash or display error message. That would attract attention to the fact that those software are broken. BUT ! Most users will believe that errors appear because Vista is buggy. The new version will get a bad reputation (as if the rest wasn't enough) and no users would like to switch. Microsoft would loose valuable market shares.
        -> So that's why microsoft doesn't do it.
        This behavious only works on Unices because most of the other software function correctly and users guess that the problems comes from the badly-behaving software and they try to download a corrected newer version or a better alternative.

        - ASK USER'S PERMISSION. Do some 'sudo'-style privilege escalation for every single action that would require admin rights. And hope that developer will notice and produce more Vista-compatible softwares.
        -> This is what microsoft has done, BUT THIS IS FUNDAMENTALLY WRONG.
        Because concerning users :
        - It floods them with a mass of annoying blocking popups asking for privileges. The users ends-up first answering OK to everything (and the Unix style protection is completly lost) and then they disable the whole UAC to stop the flow of popups. So it is as if it wasn't introduced in vista in the first place.
        And concerning developers :
        - As pointed by other /. developpers will be slow to change. They don't write code "perfect by the book", code that "somewhat works" is enough for most of them. Read sites like this [thedailywtf.com] if you don't believe.
        - Changing may be difficult for them, because it would require re-doing the whole program architecture. Or it could pose problem to migration between the older bad-behaving version and the newer vista-compatible version, and there's a huge users pool that the developpers want to avoid pissing because of a non-trivial migration.
        - And finally, they aren't compelled to change this, because users are running with UAC disabled anyway.

        The last solution would be :
        - VIRTUALIZE IT. Put all old-world (pre-Vista) software in a sandbox, a chroot jail, or whatever it is called in Windows. Whenever some pre-Vista software tries to access stuff it shouldn't in a normal user context, just do it - but on a dummy local copy to both avoid damaging the system and avoid annoying the user. That's the route that Apple has went were pre-OSX apps are ran inside some kind of emulator. But that is easier for them because of the radical shift in architecture : older software rely on a such different API, that it had to be emulated anyway, throwing a sandbox in the mix was only an added bonus.
        Microsoft could do it as easily, because, fundamentally, Vista is XP with a shiny interface and some DRM thrown in. It would have annoyed users : They used to ran perfectly well behaving software writen for NT-Kernel under XP and suddenly, under Vista which uses mostly the same internal structure they have to run the same software inside a sandbox.
        Microsoft SHOULD have spent a lot of time planning well the transit
        • Actually, Vista does virtualize SOME attempts to write to Program Files and HKLM. In fact this was one of the touted features (the writes get redirected to user-specific areas).
      • by Maxwell ( 13985 )
        If you're really seeing UAC that often, you're doing something wrong (or you're using software from developers who did something wrong). As developers get their act together and stop requiring admin privileges for trivial things (hint: using %userprofile% and HKCU rather than %programfiles% and HKLM will solve 90% of your admin-privilege requirements when developing), UAC prompts should appear less and less often, and th

        Uhmmm, yeah. On a blank, brand new Vista install, no 3rd party apps the $!#%ing UAC thin

      • HKCU is a morass and some thing belong in HKLM, especially in an environment with roaming profiles (some mandatory). When I install Word on a box, installation information (where it's located, etc.) should go in HKLM because these are things that are (and here is the kicker) _local to the machine_ and not particular to the user.

        You can't install software on a user, so anything a program needs to be successfully run after being installed needs to be HKLM.
        Now, user preferences etc. should be HKCU, because tho
      • by Altus ( 1034 )

        Its easy to blame developers but Microsoft has created this problem as much as anyone. There is very little available in terms of best practice guidelines for developing on windows and there really never has been. Developers learned mostly from the behavior of MS applications and from what was the easiest way to develop applications. UAC isn't that much different from the privlage escalation stuff on the mac but you dont see that dialog come up very much. A lot of this comes from the architecture of the
    • by DrXym ( 126579 )
      So does that mean it's not working, wasting my time, AND training me to ignore security warnings?

      Yes. As a Vista user I recommend just disabling the stupid thing.

  • by Goalie_Ca ( 584234 ) on Thursday May 10, 2007 @02:07AM (#19063421)
    How many unix developers run as root? Probably because it works in the first place! Seriously though.. windows is beyond simple refactoring and I believe that vista is the evidence. The unix model is simple and effective but best yet scales reasonably well. Daemons run as root? No.. nor do they run a joe or bob. Even as sudo, you can still limit what commands you can run. SELinux takes things to a whole other level.
    • Most daemons do run as root though - at first.

      You the have trust in the competancy of the developers that it will allocate the resources it needs then suid to a lower priveleged user.

      Admittedly thats 2 parts - one the OS being designed to let you do that.

      Two, having decent developers with well tested products - I know you wont have an issue running apache as root and letting it suid - but how about some unknown piece of software you have never heard of? Will you just run it as root without thinking? Probabl
      • by igb ( 28052 )
        The usual thing that daemons need to be root for is to allocate a port And remember, daemons dropping privileges once started is relatively new. Up until five or ten years ago they all ran as root.

        ian

  • by Frogbert ( 589961 ) <frogbert@gmail . c om> on Thursday May 10, 2007 @02:10AM (#19063443)

    I kind of like the concept of UAC. I mean the messages are so annoying that hopefully developers will start to avoid getting them pop up.

    Hopefully this will cause applications to stay the hell out of the Windows directory, the registry and wherever else they seem to think would be a good place to sprinkle data randomly. I pine for the days of being able to uninstall a program fully from my system by deleting its folder. Or being able to simply copy a configuration file from one computer to the next and having all my settings preserved.

    Perhaps I'm forgetting how bad that system was in the DOS days, and I'd welcome people reminding me, but it is looking pretty good at the moment.

    • Re: (Score:2, Informative)

      by Osty ( 16825 )

      Hopefully this will cause applications to stay the hell out of the Windows directory, the registry and wherever else they seem to think would be a good place to sprinkle data randomly. I pine for the days of being able to uninstall a program fully from my system by deleting its folder. Or being able to simply copy a configuration file from one computer to the next and having all my settings preserved.

      Just for the record, you don't have to stay out of the registry if you want to avoid admin privileges.

    • by Jeff DeMaagd ( 2015 ) on Thursday May 10, 2007 @02:20AM (#19063507) Homepage Journal
      I pine for the days of being able to uninstall a program fully from my system by deleting its folder. Or being able to simply copy a configuration file from one computer to the next and having all my settings preserved.

      I really hate to say this, but this is very similar to how Mac OS X works most of the time. Most programs are installed by dragging the icon into the Apps folder, and most programs are uninstalled by deleting them.

      Configuration files are a little more complicated, but transferring all the user settings is very easy too, there is a transfer agent that allows you to copy your apps, files and settings to another computer. I know Windows has a transfer agent, I just used it today, and unfortunately, the Windows transfer agent isn't nearly as good. A lot of the preference settings do transfer if you just copy the Library folder in your home directory, system settings are in /Library. But Migration assistant handles almost all of that, IIRC, the only thing that doesn't transfer are a few software license keys.
    • back then the folder was called directory though.
    • A bit of ridicule (Score:4, Interesting)

      by earnest murderer ( 888716 ) on Thursday May 10, 2007 @02:46AM (#19063639)
      Indeed, and I would take it one step further. I'd append to each UAC a description of why it's bad practice. Something like....

      Application X is trying to do X. This is behavior typical of malware or virus activity, but can be a product of poor developmet practices.

      It isn't going to win any friends, but will certainly bring their ego's into play. Of course if MS really had some balls they'd just make developers live within their install directory. Nothing gets in or out without a open/save dialog, provided by the system of course.

      But I also think it's awesome that MS basically absorbed the audio stack. But only because I hate Creative even more than MS. It took 15 years, but incompetent and destructive finally caught up with them.

      I suppose, like the US, Microsoft will do the right thing. Once all of the other options have been exhausted.
      • Woo! Someone who agrees with me about Creative! I think they are scum who mismarket their products, and sell products that only function properly when 3rd parties take it upon themselves to write drivers for them! (c.f. kxproject)

        OT I know! But drawing attention to Creative's unethical practices can never be a bad thing.
    • Gentle Reminder... (Score:3, Informative)

      by HaeMaker ( 221642 )
      @ECHO OFF
      PROMPT $p$g
      C:
      CD \NWCLIENT
      SET NWLANGUAGE=ENGLISH
      loadhigh LSL
      loadhigh NE2000
      loadhigh IPXODI
      VLM
      CD \
    • I pine for the days of being able to uninstall a program fully from my system by deleting its folder. Or being able to simply copy a configuration file from one computer to the next and having all my settings preserved.

      Modern systems are just too complicated for that. If you've got multiple users, the configuration is going to be scattered around. If it runs as a daemon or has shell hooks, it has to go somewhere too. If your program has any dependencies, it's going to have to install a shared library (DLL

      • by Ed Avis ( 5917 )
        If the shared library is only used by that program and no others, then it should go in that program's directory.

        On the other hand, if it's a DLL that is used by several applications, then this one app has no real business installing it in the Windows directory and especially not overwriting an existing copy of the same library (even with a newer version). There should be a separate package for the library which manages the library's files, and which can be marked as a dependency by any application that wan
    • Re: (Score:3, Informative)

      by Tom ( 822 )

      I pine for the days of being able to uninstall a program fully from my system by deleting its folder.
      http://www.apple.com/macosx/ [apple.com]

      Granted, some crap comes with a windos-like "installer", but on OSX you actually "install" most programs by drag&drop to the applications folder, and you uninstall them by drag&drop from applications to trash.
      • Re: (Score:3, Informative)

        by TheRaven64 ( 641858 )
        This doesn't actually uninstall the application, however. Most applications use NSUserDefaults, at the very least, which stores a dictionary in ~/Library somewhere (and possibly /Library). You need to delete this, if you want a complete uninstall.

        The problem with the OS X method is that it can't differentiate between removing because you are uninstalling and removing because you are upgrading. It would be nice if the user defaults system did some kind of auto-cleaning, where defaults created by progra

    • Unfortunately, if you put files in the Program Files folder, then you need admin privileges.

      So, you need to put the 'static' program apps and so in /ProgramFiles and then put your per-user data in either the HKCU registry or in the user's own /Application Data folder.

      If they were the 2/3 places you could find an app's files then I think that'd be fine.
  • by Xiroth ( 917768 ) on Thursday May 10, 2007 @02:12AM (#19063451)
    Hmm, I'd say he's got a good point - there's simply not a culture of privilege awareness in Windows developers.

    Perhaps Microsoft should set up an audit unit and start giving software a 'UAC-compatible' tick if a piece of software has minimised how much UAC approval is required if its turned on, allowing the publisher to put it on their box so that the customers can tell. Who knows, perhaps one day the UAC system might actually be viable.
    • Re: (Score:2, Funny)

      Hmm, a software company approves another software company's software.

      Nope. Can't see it happening.
    • Re: (Score:2, Insightful)

      by Osty ( 16825 )

      Perhaps Microsoft should set up an audit unit and start giving software a 'UAC-compatible' tick if a piece of software has minimised how much UAC approval is required if its turned on, allowing the publisher to put it on their box so that the customers can tell. Who knows, perhaps one day the UAC system might actually be viable.

      In theory, that already exists [msdn.com]. In order to use the "Certified for Windows Vista" logo on your software, you have to play nicely with UAC.

    • Re: (Score:2, Interesting)

      by 280Z28 ( 896335 )

      Hmm, I'd say he's got a good point - there's simply not a culture of privilege awareness in Windows developers.

      Perhaps Microsoft should set up an audit unit and start giving software a 'UAC-compatible' tick if a piece of software has minimised how much UAC approval is required if its turned on, allowing the publisher to put it on their box so that the customers can tell. Who knows, perhaps one day the UAC system might actually be viable.

      That is actually THE first requirement listed in the Certified for Windows Vista Logo Technical Requirements [microsoft.com]

    • Software requiring admin privileges is a problem. I think it's irritating that user-type software requires admin settings to work. That makes idiot-proofing a computer a lot harder.

      I think it is a carry-over of the 16 bit Windows compatibility though, from the 9x series to NT series Windows. For 9X, there were no security considerations like this, and for NT series, compatibility seemed to require admin rights, and developers didn't change their programming practices because they didn't have to.
    • Perhaps a better way to address at least part of the problem would be to have a special compiler option in Visual Studio that's turned on by default in debug configs. The option would cause a dialog box to be displayed anytime a folder or registry subtree is accessed in a way that a non-admin user would be denied access.

      Yeah, it wouldn't help anyone who's not developing in Visual Studio, and it wouldn't help anyone at this point who neglected to patch their copy of VS. But at least it would provide helpfu
    • Re: (Score:3, Insightful)

      by ocbwilg ( 259828 )
      Perhaps Microsoft should set up an audit unit and start giving software a 'UAC-compatible' tick if a piece of software has minimised how much UAC approval is required if its turned on, allowing the publisher to put it on their box so that the customers can tell. Who knows, perhaps one day the UAC system might actually be viable.

      That's great and all, but they already do something similar. Ever see a shrink-wrapped box at the store with the "Designed for Windows" logo on it? Part of the logo testing is t
  • by QuantumG ( 50515 ) <qg@biodome.org> on Thursday May 10, 2007 @02:39AM (#19063607) Homepage Journal
    on Windows, on Unix and on OS X.

    The problem on Windows is that it is a single user operating system with delusions of being a multi-user operating system.

    The problem on Unix is that it is a time sharing operating system which people inexplicably use as a workstation operating system.

    The problem on OS X is that there are no serious threats, so no-one has any idea if their security model does anything because it never gets tested.

    And the problem with all three of them is that they assume that the program will always do what the user wants and therefore the program should inherit permissions from the user. On Windows that was never true. On Unix it was only true back when all users were developers and had enough time to read the source code to all the programs they ran and thus felt they could trust them. On OS X it was actually true because, again, no-one writes malware for OS X.

    The security model should be, quite simply: the program has a manifest that declares what permissions it needs with a fine granularity. The permissions should be placed into a hierarchy. For example: writes to disk -> writes to user files -> writes to user files of type X. The user should be able to inspect these permissions to determine if they are acceptable. If they are not, then the user should be free to uncheck "required" permissions.. the program should still run but those functions of the program which invoke a required permission should cause a prompt. The prompt should give the option to deny the request, or fake the request so it appears to the program that it completed successfully.

    And yes, developers should use this mode.. and they would, because it is actually useful instead of just being a pain.
    • Won't work (Score:5, Insightful)

      by iangoldby ( 552781 ) on Thursday May 10, 2007 @04:03AM (#19064035) Homepage
      That won't work for the same reason that the current Windows security model doesn't work.

      It's too much trouble.

      I believe this is one of the main reasons why UNIX applications generally do not play fast and loose with permissions. The security model is very simple. A process is owned by the account most suitable for the role it will perform. There's no need for complicated LPSECURITY_ATTRIBUTES structures. (And yes, I do think that even those are too complicated for most purposes, so you can guess what I think of the more esoteric aspects of Windows security tokens.)

      Be honest, if you program for Win32, how many times have you just passed NULL as the first parameter of CreateEvent()?

      If you want to make people do the Right Thing, make the Right Thing easier to do than the Wrong Thing.
      • Re: (Score:3, Interesting)

        by iang ( 144697 )
        Actually, passing NULL as the first parameter of CreateEvent is almost always the right thing to do.

        Of course the vast majority of developers don't actually know that - they just pass NULL out of laziness. But it turns out that if you spend the time it takes to learn the intricacies of the Win32 security model, you'll still end up passing NULL once you understand what's happening.

        You just get to feel smug about it.
    • by Tom ( 822 )

      And the problem with all three of them is that they assume that the program will always do what the user wants and therefore the program should inherit permissions from the user.

      Bingo!

      Where is my "run this program but don't give it access to any of my data" option? That is something I want and that users will understand. Explicitly granting permission to syscall 0x6f03a4b loopback technobabble nonsense does not and never will fly with users who feel more intimidated than protected. Granting "permission to accept your personal data" is more like it. So run everything in a sandbox unless I explicitly allow it to read my files. Once. Because we all know that if I've given root/user/w

    • There is a simpler solution: virtualize the O/S for users. Let users play their own version of the O/S, but without a problem for the other users.

      Microsoft should have done that right from the start, because their O/S was single user from the beginning.

      Another idea is that of protection rings, similar to 80x86 architecture: let each system resource belong in a ring, and allow access to resources only from privileged rings; access less privileged rings only through secure predefined gates. The nice thing wit
      • virtualize the O/S for users. Let users play their own version of the O/S, but without a problem for the other users.

        This is almost what UNIX does (and what Plan 9, which is more UNIX than UNIX, actually does). The problem is that it protects users from other users, but it doesn't protect users from malicious applications.

        In an ideal world, all software would be run using the principle of least privilege. My web browser would be able to link to the libraries it needs, read and write to a configuration file / folder, and write files into a downloads directory. You can do this fairly easily on a modern *NIX using som

    • Re: (Score:3, Informative)

      by DrXym ( 126579 )
      The security model should be, quite simply: the program has a manifest that declares what permissions it needs with a fine granularity.

      That would be called SELinux and is turned on in Fedora Core.

      Writing policy files either as a user, admin or even developer is hellishly difficult. FC has been messing with SELinux policies for years before getting it right. It almost requires an interactive mode where the policy can be "trained" by running the app a multiple times to see what registry / folder / files i

    • by batkiwi ( 137781 )
      I don't know if you're fishing for this reply, but this is ALMOST exactly what .NET does (everything except for the prompting... it simply errors if a program isn't allowed to do something). Read up on trust policies, declarative security, and "code access security" in .net.

      It's not fully "user friendly" yet (it was originally designed around group policies in a corporate environment), but newer versions of .NET are getting more and more user configuration. The basic idea is that you set up "zones" (like
  • They're half-right (Score:3, Insightful)

    by Durandal64 ( 658649 ) on Thursday May 10, 2007 @02:39AM (#19063609)
    Is there an onus on developers to actually write code that's aware of privileges? Absolutely. Windows developers have gotten a free ride with respect to access rights for a long time, but that party's over. But can Microsoft just throw up their hands and say "Okay guys, it's on you now"? Absolutely not. The reason developers have gotten away with this for so long is that Microsoft's own conventions and practices encouraged this. Users were set up with root-equivalent permissions by default, and there was no authentication mechanism in place (and there still isn't).

    Microsoft should've deprecated UAC heuristics and put a time limit on them. They should've given developers a year (or so) to update their applications to be aware of privileges, and then simply remove the UAC heuristic features that "guess" whether an application needs privileges. So if you run an installer built for Windows XP, it doesn't get the right privileges without you explicitly launching it with admin rights.
    • They should've given developers a year (or so) to update their applications to be aware of privileges
      They did. Vista was in beta-testing for a long time.
      • by chaboud ( 231590 ) on Thursday May 10, 2007 @05:04AM (#19064355) Homepage Journal
        Note: I'm normally a Microsoft defender here, but I've spent too much of the last eight months dealing with Vista breaking-changes. Onto the rant...

        This is such utter nonsense. UAC first came in, IIRC, in Beta 2 (May), but there were far too many problems with Vista over the beta/RC cycle to be workable. UAC was too annoying to leave turned on while trying to figure out the real bugs. UAC is still awful over remote desktop on a slower connection, as it blanks the screen. This cycle was nothing like the 2k or XP cycles with regards to beta and RC stability and direction.

        One of our long-released apps went through this:

        Beta 1:
        Some draw issues, crashes on exit.

        Beta 2:
        Some draw issues, just fine.

        RC1:
        Some different draw issues, crashes a helper process on startup, then a second crash, completely, app dead.

        RC2:
        Some completely different draw issues (others gone), otherwise fine.

        Release:
        Same draw issues as RC2, crashes a helper process on startup, annoying help pop-up for any plug-in expecting old-school help to be available.

        This was a released app for which the shipping bits did not change, at all, over the Vista cycle.

        Now, it gets worse with UAC, because there are things that get more restrictive when the user gets sick of UAC and turns it off. The most obvious example is the "can't write to the TEMP folder" defect (by design? The designer is defective.). This kept several installers from working properly. If the user shuts UAC off, apps can no longer write to the TEMP directory and run their expanded installer app (winzip installer approach). This means that getting tired of UAC and pulling the plug on this behavior still interferes in the use of the system. In this case, it will hand the user a cryptic error message and no direction.

        They went down this road with things like broken file-sharing and remote-desktop access with no-password accounts in XP, and it continues throughout Vista. Users of Microsoft products are regular victims of hidden behaviors, where seemingly simple changes can have much-delayed distant results.

        Microsoft once cared a great deal about backwards compatibility. Now they seem to expect all software vendors to re-code, re-compile, re-test, and re-deploy for an OS change, and that OS was a moving target for the year preceding its release.

        We're handling it, but what happens to the software that was orphaned by companies that died (or moved to a different platform)?

        • by ocbwilg ( 259828 )
          Microsoft once cared a great deal about backwards compatibility. Now they seem to expect all software vendors to re-code, re-compile, re-test, and re-deploy for an OS change,

          Yes, that's true. This was also the time when Microsoft didn't give a rat's ass about security. Unfortunately they kept getting raked over the coals for having glaring security holes, so they are focusing more on creating an environment that is/can be/should be more secure, and as a result developers who've been able to code howeve
          • Even if IT could have a policy whereby we won't approve any application for use in our environment that won't run as a restricted user, we would inevitably be overruled when that new killer app from the leader in the marketspace dazzles our CEO with grand new functionality.

            Sadly, this is so true. Also, when the vendor out-and-out lies about these issues to make the sale. Lesson learned - if it isn't in the contract, anything the vendor told you means jack.

            ...find out what restricted system areas their a

    • >> Microsoft should've deprecated UAC heuristics and put a time limit on them.
      They did.

      NT domains running environments where users are not trusted and do not have permissions to modify the system have been around for over a decade. That was also roughly when the windows equivalent of /usr and /home appeared.
      Microsoft software has been properly using these for all this time, setting proper example.
      Vista was in beta forever. Any software vendor that was caught by surprise by the instatement of UAC shoul
  • by hexed_2050 ( 841538 ) on Thursday May 10, 2007 @02:59AM (#19063711)
    Once people start to understand UAC and how it works, people will begin to harness it and accept it rather than shun away from it.

    UAC allows administrators to be logged in 24/7 without having 20+ privileges until the actually need that power. 99% of the time UAC will strip the administrator privileges away from the administrator and grant them with 6 SeXXX privileges to work with. It does this by using two different tokens instead of one. The first is a normal user token, and the second is the real administrator token. When you see that screen where UAC asks for elevation, that's when Vista will grant you the administrator token. Don't believe me? Type "whoami /priv" in a normal shell under the administrator logon. Now open up a shell using "Run as administrator" and type "whoami /priv".

    Vista isn't the shining example of everything secure, but it sure is lightyears ahead of XP and a real good step in the correct direction. Windows users will whine and gripe about it, but they will eventually have to go through the same stuff the *nix crowd did along time ago when people were logged in with root 24/7.

    If you require Vista to elevate you with certain apps, then create a .manifest file and place it in the same directory as the .exe. The manifest file is just an xml file that tells Vista that the .exe will require administrator privileges to run (queue UAC.) Google "vista manifest" or check this out for more information: http://channel9.msdn.com/Showpost.aspx?postid=2112 71 [msdn.com]

    Enjoy..

    h
  • by Anonymous Coward on Thursday May 10, 2007 @03:47AM (#19063945)
    I've spent the last eight years of my life packaging and deploying apps for Corporate environments.

    In none of those environments were the users Administrators (or even Power Users). I have written a few scripts and applications to work around some issues, but in general, it is a case of setting the appropriate permissions in HKLM and \Program Files\. It takes some work, but I have only ever had one seriously intractable application.

    For the past 4 years I (and my family) have run primarily as users on our home PCs. Its a bit of a pain in XP, and I wrote my own Privilege escalation tool to make some things easier, but again, it is now pretty smooth. Even games work as users, with the appropriate settings. Vista (on my new laptop) is far easier, and no less frustrating than Kubuntu, which is always asking me to sudo an elevated operation.

    UAC is a good thing - it's smart, and as developers get with the program, will add protection (not frustration) for users.

  • Another non-issue (Score:5, Interesting)

    by alphamugwump ( 918799 ) on Thursday May 10, 2007 @03:53AM (#19063979)

    Rather than ask the user for permission on every operation, what other ways could Microsoft have improved Vista's security?

    What's wrong with asking the user for permission on every operation? That's what my linux box does. It's called "su", and it makes me type in my password to make system changes. In fact, that's what every real operating system has ever done. Welcome to the real world.

    A major reason for the "insecurity" of windows, IMHO, is the culture of its users. You get people who still remember 95 and 98, (and DOS) and who like to run everything as root. They don't want to be bothered with those nag boxes. But nag boxes are what it takes to secure a system. Security requires some effort on the part of the user, too. Funny how things work like that, isn't it?

    See, in the beginning, a single user OS was perfectly OK. Even if you hooked your DOS machine up to the internet, it was probably a terminal, not as a computer in its own right. And really, they had so little RAM that a full-on operating system like linux would be massive overkill. A cell phone is a multimedia powerhouse compared to those machines.

    But the microcomputers got bigger. They got a networking stack. People started using them like real systems instead of big, featureful, programmable calculators. They went mainstream, too. But the mindset of the users and developers was (and still is) somewhere way back in the 80s. The developers have gotten better; they add in UNIX features with every windows release. But the users, for the most part, just want to buy a box from Dell and have it work out of the box, like an appliance. Which is a fine thing to want, but those same users are also the kind of people who will install the purple monkey, become phishing victims, run binaries they got off P2P, and so on. And unless Microsoft locks people out of their own computers, there's not a damn thing they can do about that.

    So while it was acceptable to bash Microsoft back in the day (no firewall, single-user mode, instability, etc), most of these problems have been fixed. Oh, sure, Windows is no OpenBSD. It's kind of kludgy, compared to linux, or OSX, or your *NIX-like system of choice. But at this point, if your system gets hacked, its probably your own dumb fault. Anymore, if you whine about windows without mentioning specifics, you just end up looking stupid, not 1337 and educated.

    No, I am not a Windows fanboy. I don't dual boot, either, although I do use VMWare when I absolutely must. But it still pisses me off to see such obvious bullshit. Some of it is Apple propaganda, but a lot of it is propagated by windows users themselves. Which is understandable, I suppose, but not particularly productive.

    • by slittle ( 4150 )

      What's wrong with asking the user for permission on every operation?

      Because they're morons, don't/can't/won't understand and/or simply don't care, they just want it to work, now, no matter what the consequences. When it stops working they'll call the 10 year old kid next door or get a new computer.

      OTOH,

      See, in the beginning, a single user OS was perfectly OK.

      That's the problem: most Windows systems are still single (physical) user machines; they don't have (half-)clued in admins to manage them on the user'

    • What it takes to secure a (user desktop) system is:-
      - Not leaving ports open unless they absolutely need to be
      - Not running Outlook Express and randomly downloaded crapware
      - Using a reasonably secure browser, and avoiding popup-infested porn and warez sites
      - Not running britney_spears.exe when it arrives in your inbox .. etc.

      A secure permissions model has very little to do with it, IMHO.
  • by Kaenneth ( 82978 ) on Thursday May 10, 2007 @04:00AM (#19064019) Journal
    UAC is pretty much essential to meet the mutual goals of:

    a) run old software designed for prior windows versions.

    and

    b) be secure.

    You might want to allow, for example, an online game to delete files IF those files belong to the game, and only to the game, like obselete maps, sound files, etc. But you don't want someone to exploit a bug in the game online to hose your system; like the bug I found in Counterstrike (old version, long fixed) where putting "%D%D%D%D%D%D%D" as your playername would crash it out (classic printf issue).

    You could possibly run an app in a VM 'sandbox', but that idea breaks down as soon as you try to cut-n-paste from one app to another, or two apps want to write files in the same directory... what should it do then, prompt for Cancel/Allow for each breach of the sandbox? or have the user define complex sets of which applications are allowed to talk to each other? I did that for a Linux setup, I made seperate accounts for each service, one for the Fax receiving, one for Apache, one for each instance of the DVR simulator, one for DistCC, one for web browsing... and configured them for exactly, and only what access each needed; the Fax could put files into a directory to be served by Apache, but could not touch the templates and other pages, and nothing Apache did could touch the Fax archive and configuration, each simulated DVR had its own IP address, and couldn't see the others except via network packets. It was terribly complex, and done as a learning experiance. because everything worked perfectly when run as one user, or if p[ermissions were opened up, but it took months of spare time to get all the permissions exactly right as seperate users.

      Unless you can be absolutly sure that EVERY action a program may take is approved, it needs to be controlled. As apps get fixed up, and Vista gets service packs or whatever to improve support for specific apps, the issue will fade, but never be completely gone, because sometimes, it'll save the users ass.
  • Rather than ask the user for permission on every operation, what other ways could Microsoft have improved Vista's security?

    Excuse me, how would such a knowledge help anyone but Microsoft developers? No one but those developers have access to source code, certainly not Slashdot readers.

    The fundamental problem with Windows Security architecture is that the Operating System thinks it is better, wiser and more powerful than the user. In Unix, the user is the boss.

    If admin users can examine every single running
    • Excuse me, how would such a knowledge help anyone but Microsoft developers? No one but those developers have access to source code, certainly not Slashdot readers.

      Should we not help Microsoft developers, just because this is Slashdot?

      Some people are interested in the problem and in how to fix it. Believe it or not, some people actually like Windows.

      I'm certainly not one of those people; I've been using Ubuntu for two years. I'm just saying, they exist, hence the question. Besides, even if we're not Windows users, most of us would like to see Windows more secure; everyone would benefit from having less botnets around.

      • by jkrise ( 535370 )
        Should we not help Microsoft developers, just because this is Slashdot?

        Please read my post in full. Every single Microsoft developer knows, or definitely ought to know... that UAC is a piece of junk. The insecurity with Windows is inherent.... the OS, or Microsft or Bill Gates.. ow whoever made that design decision... think that they own YOUR computer. It is impossible to secure the operating system as long as this fundamental issue is resolved.

        Since this is a design decision taken at the very highest level
    • Re: (Score:3, Insightful)

      by iang ( 144697 )

      I don't think Microsoft are asking. I wrote the blog entry the question refers to, and I don't work for Microsoft, nor was I acting on their behalf. (And I don't imagine I've made myself any friends in Microsoft with that blog entry.) I know the guy who submitted the question to Ask /. (MythMoth) - he doesn't work for Microsoft either. In fact as far as I know he mainly runs Ubuntu these days, and he's been a Java developer for years.

      My motivation is pretty simple: I think it sucks that lots of apps have

      • by jkrise ( 535370 )
        I don't think Microsoft are asking. I wrote the blog entry the question refers to, and I don't work for Microsoft, nor was I acting on their behalf. (And I don't imagine I've made myself any friends in Microsoft with that blog entry.) I know the guy who submitted the question to Ask /. (MythMoth) - he doesn't work for Microsoft either. In fact as far as I know he mainly runs Ubuntu these days, and he's been a Java developer for years.

        Thanks for taking the time to post a rejoinder. My query wasn't on your i
        • by NekoXP ( 67564 )

          Why, I thought it would be obvious to anyone who's used Unix-like systems for a year, let alone 15. If I install ANY FLAVOUR of Linux in a 4GB partition, and I copy that entire partition to a spare partition using the simple 'tar' command... I can rest assured that if the OS crashed, it's a simple matter of running a 'tar' command to get it back working - WITH ALL APPLICATIONS, SETTINGS etc. INTACT. Try doing that with Windows.... ANY version.

          Wow, that's not even slightly close to a good example of what you

  • Historical problem (Score:4, Interesting)

    by Lonewolf666 ( 259450 ) on Thursday May 10, 2007 @04:06AM (#19064049)
    From the blog linked in TFA:

    The culture is different on these other operating systems. On UNIX, you'd be considered nuts if you ran as root all the time. And if you wrote a program that demanded to be run as root for no good reason, your application would be shunned, and rightly so.
    and:

    If you are a developer who has turned off UAC in frustration, remember that UAC is only this way because of all those software developers who insist on running as admin. It's not Windows you should be looking to blame.

    I think that this is, in turn, a consequence of earlier Microsoft operating systems (Windows 3.x to ME) that did not have security features worth mentioning. Unix had a clear differentiation between user and admin (root) rights since decades. Windows did not, and essentially everyone was administrator.

    As a result, lots of applications got written that implicitly required admin rights, accidentially or because it was the path of least resistance for the developer. As a result of that, people got used to work as administrators all the time on the newer systems (Win NT and later) too. As a result of that, there was less pressure to clean up the applications.

    Now Microsoft is trying to break that vicious circle with UAC, but it seems they are not very successful... as it is once more the path of least resistance to turn it off ;-)
  • UAC is cosmetics (Score:5, Insightful)

    by Opportunist ( 166417 ) on Thursday May 10, 2007 @05:01AM (#19064333)
    UAC cannot and will not mean secure computing. It's been pointed out before, that "may X do Y" dialoge comes up so friggin' often that users either turn it off or click "yes" on everything.

    And that does not only apply to "clueless" users. Of course, someone who has no idea what the computer does and just why an application like explorer.exe has no business beyond the local net, will click yes on the "when in doubt, click yes or it won't work" presumption. The problem is that many Windows-Services are started in ways that make it impossible to determine whether a given program is supposed to do this or that, because there are many started using wrapper programs.

    Many services are started using an application to start services. And you ONLY see that application, not (necessarily) the drivers it aktually loads. Some of them need to get access to very core deep functionality. And, unfortunately, can be abused to start trojans.

    Generally, the problem lies in the untidy separation between system and user. As has been pointed out before, too, one of the problems is that developers didn't care too much about access rights so far, because you could readily assume that the user had administrator privileges, so key hives like HKLM were overused, even when unnecessary.

    Another problem is that UAC is an "all or nothing" privilege mechanism, at least when it comes to installers. You either unlock the whole system or nothing. And this is even for a user with some knowledge no trivial matter to decide. You download a game from some demo page and it requests elevated privileges. Is it because it needs to set a key in HKLM, which is maybe unneeded but not critical, or is it because it comes bundled with some spyware that wants to root itself deeply in your system?

    Basically, to me it seems that UAC is MSs way to shift the blame for infections away from them, and (mostly) towards the user. You allowed it to happen, we warned you, you clicked yes.
  • Microsoft did not invent sudo. They are the absolute last of the pack to implement it.

    It's been optional to use forever. Restricted environments (where users still need to work, save files, etc) have been running in NT domains configured to disallow system modification forever and a decade. Vista's been in beta forever, and you need to have been on the friggin moon to not have known well in advance UAC is coming.

    If your software writes outside your profile without a very good reason to do so, either update
  • developers are lazy and sloppy.

    It's not just Windows developers running as admin. It's C programmers using sprintf. It's java programmers catching all throwables. It's web programmers taking some string of unknown origins and handing it to a SQL interpreter connected as an account that has DML privs.

    What makes a difference is consumers. Unix users don't accept programs that run as root. MacOS users get somewhat better UIs because they demand it. Windows users use Windows because they feel they have
  • 1. UAC is not SUDO

    UAC is completely unrelated to sudo. It's an extension of the proxy privileged service scheme they've been using all along. It's not a bad model... it's much like what SafeTcl slave interpreters use... but it shouldn't be confused with "su", "setuid", or "sudo" in UNIX.

    2. What they did wrong

    Security is like sex, once you're penetrated you're ****ed. UAC, reduced privilege mode to run IE in, all the extra dialogs and warnings and security centers of the last ten years, they're all attempts to reduce the damage or pass the blame for the penetration on to the user. The solution is not to add more layers of annoying mitigation after IE, Outlook, and other applications that use the HTML control are inevitably penetrated. The solution is to redesign the HTML control so that it doesn't provide a security penetration API (the way ActiveX works in IE, that's what it comes down to) in the first place.

    Instead, they present Silverlight, based on .NET, complete with its own security penetration API. :p
  • Windows NT has been out for well over 10 years now and has ALWAYS been a multi-user OS. Windows NT4 was the first really user-friendly version of NT and was the version I started using and never looked back. Developers NEVER coded apps with this in mind, they were too busy hacking together apps to run on Windows 95 and if they worked on NT great. I'm not talking about little utilities or games here either. Photoshop, Office, 3DS Studio MAX, you name it, none of them took into account the security featur
    • by JoeD ( 12073 )

      I've been saying this for years. It all stems from MS-DOS. There, you could put anything anywhere, and nothing cared. Then the DOS developers moved to Windows, and kept the habit. Then Windows went multi-user, and suddenly stuff started breaking.

      So the user calls the vendor for help. Support calls cost money. So the vendor takes the quick way out and tells people to run as Administrator. Program runs now, so the problem appears to be fixed.

      And to be fair, I've been guilty of this myself.

      But so have o
  • by Quantam ( 870027 ) on Thursday May 10, 2007 @10:32AM (#19067209) Homepage
    Contrary to what a few mindless Linux zealots will tell you, Windows NT has always been an isolating multi-user system. That is, multiple users are supported, and each user's data is protected from other users, as well as system data (all the stuff outside the users' home directories). Always. However, NT's backward compatibility wasn't so good at first, particularly with 16-bit programs. As as result, even though it was relatively stable and secure, it was pretty rare for quite a few years.

    The admin problem really comes about with Windows 9x, which was released a couple years after Windows NT. Windows 9x is not an isolating multi-user system; in fact, it basically has "multi-user" capabilities strapped on to Windows 3.1. There's no file system or registry permissions, nor is there a distinction between admin and vanilla user. Windows 9x quickly became popular, as it had fairly good backward compatibility with DOS and Windows 3.1 programs, and was significantly better than Windows 3.1 in general (though nowhere near comparable to NT). So, developers everywhere started writing programs for Windows 9x. Most of these programs didn't need to run on NT (as it was a niche market for some 7 years after release), so they didn't. Dealing with limited access was more difficult, and programmers were lazy.

    Consequently, by the time NT finally overthrew 9x (with Windows XP), you had a huge number of existing programs that assumed full access of the computer (for one particularly bad example, the Mechwarrior: 2 Mercenaries installer used CLI and STI for something or other - kernel mode instructions; this blew up very badly on NT, so I did some debugging). But much worse, you had an entire generation of programmers that didn't know how to work with limited user. And since most users were forced to run in admin so that they could run legacy programs in XP, the developers figured that they didn't need to learn, and the problem became self-perpetuating.

    In conclusion, YES, developers are 100% to blame for the admin problem. Granted some of those developers are in MS, but in general I've found MS programs to work FAR better than third-party programs, with regard to requiring admin. I'm speaking as someone who has been running as limited user for several years and runs MS programs like Visual Studio and Office very frequently.

    As a footnote, I really wish NT offered a service to allow programs to temporarily elevate their privileges (such as getting write access to their program directory) to install patches without requiring admin (once the service verifies that the patches are properly signed). Myself and a friend are considering making such a service ourselves, actually.

Our OS who art in CPU, UNIX be thy name. Thy programs run, thy syscalls done, In kernel as it is in user!

Working...