<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Aaron Margosis' &amp;quotNon-Admin&amp;quot and App-Compat WebLog : Fixing LUA Bugs</title><link>http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx</link><description>Tags: Fixing LUA Bugs</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>LUA Buglight 2.1 released</title><link>http://blogs.msdn.com/aaron_margosis/archive/2009/11/03/lua-buglight-2-1-released.aspx</link><pubDate>Tue, 03 Nov 2009 21:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9916989</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/9916989.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=9916989</wfw:commentRss><description>&lt;P&gt;LUA Buglight 2.1, identifies admin-permissions issues ("LUA bugs") in desktop applications.&amp;nbsp; New version supports Windows 7 (x86 and x64), Vista (x86 and x64), XP (x86 only) and corresponding Server OSes.&lt;/P&gt;
&lt;P&gt;The download and more information is on this page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/pages/LuaBuglight.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/pages/LuaBuglight.aspx"&gt;http://blogs.msdn.com/aaron_margosis/pages/LuaBuglight.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9916989" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Vista_2F00_Win7/default.aspx">Vista/Win7</category></item><item><title>"LUA Bug" demo app</title><link>http://blogs.msdn.com/aaron_margosis/archive/2008/11/07/lua-bug-demo-app.aspx</link><pubDate>Fri, 07 Nov 2008 16:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9052217</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/9052217.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=9052217</wfw:commentRss><description>&lt;P&gt;I do a lot of presentations on how to identify and fix "LUA bugs" in applications (*), both for Windows XP and Windows Vista.&amp;nbsp; I frequently use a little VB6 application to demonstrate writing to various portions of the file system and registry, write to .ini files in protected locations, restart services, explicitly check for admin rights, etc.&amp;nbsp; People have asked me to post that app to my blog so that they can use it too.&amp;nbsp; So here it is, including the VB6 project/source code.&lt;/P&gt;
&lt;P&gt;As is, no support, hopefully it's self-explanatory!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris Jackson has a more elaborate demo app with full lab script, geared toward application compatibility tools and techniques on Vista.&amp;nbsp; You can get it &lt;A class="" href="http://blogs.msdn.com/cjacks/archive/2008/01/03/stock-viewer-shim-demo-application.aspx" mce_href="http://blogs.msdn.com/cjacks/archive/2008/01/03/stock-viewer-shim-demo-application.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;(*)&amp;nbsp; "LUA" = "limited user account", a.k.a., "non-admin", "standard user"&lt;BR&gt;"LUA bugs" = application or feature of an application that 1) works when run by a member of Administrators or Power Users; 2) fails when run by a standard user; and 3) has no valid business or technical reason for requiring administrative control over the computer.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9052217" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/aaron_margosis/attachment/9052217.ashx" length="33072" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category></item><item><title>LUA Buglight 2.0, second preview</title><link>http://blogs.msdn.com/aaron_margosis/archive/2008/11/06/lua-buglight-2-0-second-preview.aspx</link><pubDate>Thu, 06 Nov 2008 17:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9049069</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/9049069.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=9049069</wfw:commentRss><description>&lt;P&gt;LUA Buglight is a utility that helps identify "LUA bugs" in applications -- application features that that fail as standard user but that work as administrator.&amp;nbsp; I work on it in my spare time, so progress has been slow.&amp;nbsp; Attached to this blog post is the second preview version of LUA Buglight 2.0.&lt;/P&gt;
&lt;P&gt;Main changes since the previous preview:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Single executable:&amp;nbsp; all the helper DLLs, EXEs, etc., are self-extracted to your temp folder when you run the program.&amp;nbsp; No need to copy lots of files around.&lt;/LI&gt;
&lt;LI&gt;For Vista:&amp;nbsp; the helper program that requires elevation is now signed, so you get the nicer elevation prompt.&amp;nbsp; The driver file for Vista is signed as well, so startup is much faster.&lt;/LI&gt;
&lt;LI&gt;Explicit check for x86 -- sorry, the current version cannot be used on 64-bit versions of Windows.&lt;/LI&gt;
&lt;LI&gt;Various bug fixes.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Some of the improvements of LUA Buglight 2.0 over 1.0:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Much better Vista support&lt;/LI&gt;
&lt;LI&gt;Streamlined UI and improved flow&lt;/LI&gt;
&lt;LI&gt;Identifies more bugs&lt;/LI&gt;
&lt;LI&gt;On XP, not restricted to using a local admin account to create the "this-user-as-admin" context&lt;/LI&gt;
&lt;LI&gt;On Vista, prompts for elevation just one time per session instead of for each test&lt;/LI&gt;
&lt;LI&gt;Log file names autogenerated with timestamp in the name to avoid accidental overwrite of previous logs.&lt;/LI&gt;
&lt;LI&gt;User options saved to the registry.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9049069" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/aaron_margosis/attachment/9049069.ashx" length="761281" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category></item><item><title>LUA Buglight 2.0 - preview</title><link>http://blogs.msdn.com/aaron_margosis/archive/2008/06/13/lua-buglight-2-0-preview.aspx</link><pubDate>Fri, 13 Jun 2008 07:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8594021</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/8594021.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=8594021</wfw:commentRss><description>&lt;P&gt;Attached to this blog post is a &lt;EM&gt;PREVIEW VERSION&lt;/EM&gt; of LUA Buglight 2.0.&amp;nbsp; LUA Buglight is a utility that helps identify "LUA bugs" in desktop applications -- the bugs that appear when the application is run as a standard user instead of as an administrator.&lt;/P&gt;
&lt;P&gt;Some of the improvements in LUA Buglight 2.0 over its predecessor:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Much better Vista support&lt;/LI&gt;
&lt;LI&gt;Streamlined&amp;nbsp;UI and improved flow&lt;/LI&gt;
&lt;LI&gt;Identifies more bugs&lt;/LI&gt;
&lt;LI&gt;On XP, not restricted to using a local account to create the admin context&lt;/LI&gt;
&lt;LI&gt;On Vista, prompts for elevation just one time per session instead of for each test&lt;/LI&gt;
&lt;LI&gt;User options saved to the registry&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There are more improvements and refinements that I want to make, but I think you'll find it is quite usable now.&amp;nbsp; And I promised some audiences here at Tech*Ed that I would post a preview version here prior to my Friday morning session introducing LUA Buglight 2.0. :-)&lt;/P&gt;
&lt;P&gt;Note that I haven't written up new documentation yet, and that these binaries have not been signed yet.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Update, June 14:&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;Yes - meant to mention - LUA Buglight is designed only&amp;nbsp;for x86.&amp;nbsp; I'll add a processor check on startup.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=+1&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color=red&gt;Update, November 6:&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; Removing the attachment, because the Second Preview version is now available &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2008/11/06/lua-buglight-2-0-second-preview.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2008/11/06/lua-buglight-2-0-second-preview.aspx"&gt;here&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8594021" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Vista_2F00_Win7/default.aspx">Vista/Win7</category></item><item><title>LUA Buglight updated information</title><link>http://blogs.msdn.com/aaron_margosis/archive/2007/02/15/lua-buglight-updated-information.aspx</link><pubDate>Fri, 16 Feb 2007 02:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1686542</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/1686542.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=1686542</wfw:commentRss><description>&lt;P&gt;I've meant to provide more info and follow-up regarding &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx"&gt;LUA Buglight&lt;/A&gt;, the tool I wrote to help identify "LUA bugs".&amp;nbsp; "LUA bugs" are the issues that cause a program to work only when run as admin (elevated).&amp;nbsp; Here are some quick notes...&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1.&amp;nbsp; Internationalization:&lt;/STRONG&gt;&amp;nbsp; there is an issue when LUA Buglight is used on non-English systems -- the XML is ANSI-coded, but there is no processing instruction indicating what encoding the LuaBuglightReporter should use,&amp;nbsp;so the Reporter may report an error if the system's default encoding doesn't match up.&amp;nbsp; This will be fixed in the next version.&amp;nbsp; In the meantime, the workaround is to open the resulting XML in Notepad, and add the following line at the beginning of the file:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;?xml version="1.0" encoding="windows-1252" ?&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can then open the XML file with the LuaBuglightReporter.&amp;nbsp; From everything I have heard,&amp;nbsp;that fixes this particular issue.&amp;nbsp; Please let me know if you still run into problems.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2.&amp;nbsp; Cisco Network Assistant and a pretty cool, non-intrusive fix method:&lt;/STRONG&gt;&amp;nbsp; JohnCKirk asked &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx#750689" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx#750689"&gt;here&lt;/A&gt; and &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx#751930" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx#751930"&gt;here&lt;/A&gt; about issues he ran into&amp;nbsp;testing Cisco Network Assistant v4.1.&amp;nbsp; I downloaded it and tested for myself.&amp;nbsp; I ran the installation program as Administrator in an up-to-date Windows XP SP2 image on Virtual PC.&amp;nbsp; I then switched to a standard user account, and ran the program using LUA Buglight, using the target process name and startup folder specified in the shortcut that had been placed on the desktop.&amp;nbsp; I was able to run the program using LUA Buglight without any problem.&amp;nbsp; It reported two issues, both involving&amp;nbsp;files called "LOCK" in a couple of&amp;nbsp;its installation folders under %ProgramFiles%.&amp;nbsp; In one case, it just tried to create the file; in the other case it tried to create the file, change its attributes, and delete the file.&lt;/P&gt;
&lt;P&gt;When I ran the program without using LUA Buglight, the splash screen came up, and after a short while it just became stuck&amp;nbsp;on one initialization step.&amp;nbsp; &lt;A class="" href="http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx"&gt;Process Explorer&lt;/A&gt; showed that it was consuming lots of CPU, and &lt;A class="" href="http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx"&gt;Process Monitor&lt;/A&gt; showed it in an infinite loop alternately hitting an Access Denied trying to create one of the LOCK files and writing that fact to a log file in the current user's profile.&amp;nbsp; I had to kill the process.&lt;/P&gt;
&lt;P&gt;In order to create a file in a folder, the user needs to have permissions on the folder.&amp;nbsp; However, &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/638148.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/638148.aspx"&gt;changing ACLs on folders is much more dangerous than changing ACLs on files&lt;/A&gt;.&amp;nbsp; What a lot of programs do when writing "test" files like LOCK is that they&amp;nbsp;verify whether the file Create/Open succeeded, but don't&amp;nbsp;verify whether the subsequent Delete succeeded.&amp;nbsp; So, logged in as admin, I created the two LOCK files in the folders where the program tries to write them.&amp;nbsp; I then granted the non-admin user "Read &amp;amp; Execute", "Read", and "Write" permissions on those files.&amp;nbsp; Note that these permissions do not include the "Delete" permission.&amp;nbsp; When I ran the program again as a non-admin user, it started up without a problem.&amp;nbsp; As long as an admin doesn't delete those files, the non-admin should be able to run the program.&amp;nbsp; The Create/Open always succeeds, and the Delete silently failing keeps the files there for the next time the user runs the program.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3.&amp;nbsp; LUA Buglight limitations on Windows Vista:&lt;/STRONG&gt;&amp;nbsp; When I wrote LUA Buglight, I focused almost entirely on getting it to work on Windows XP and Windows Server 2003 -- the platforms most of my customers were using and probably will continue to use for a while.&amp;nbsp; (US Federal government -- not always the quickest technology adopters.&amp;nbsp; Some of them have rotary cell phones. :-)&amp;nbsp; (Just kidding.)&amp;nbsp; LUA Buglight&amp;nbsp;works very well&amp;nbsp;on XP and 2003.&amp;nbsp; At the very end I&amp;nbsp;spent some time building&amp;nbsp;a version that would run on Windows Vista.&amp;nbsp; It does, but with some limitations.&lt;/P&gt;
&lt;P&gt;Windows Vista introduces Integrity Levels.&amp;nbsp; With User Account Control, members of the Administrators group typically run with only Standard User rights, and most programs run at the Medium Integrity Level.&amp;nbsp; When the admin user chooses to elevate a program (e.g., with the "Run as administrator" context menu option), it runs at High Integrity Level, with "Administrators" enabled in the access token, and powerful privileges like "Backup", "Debug", and "Load Driver", available for use.&lt;/P&gt;
&lt;P&gt;When you test a program with LUA Buglight on Windows Vista, LUA Buglight launches an elevated helper process in order to get the "this-user-as-admin" token for use when the target program hits an "access denied" error with the normal token.&amp;nbsp; The elevated helper process duplicates its token back to the Medium integrity LuaBuglight.exe process.&amp;nbsp; However, a Medium integrity process cannot impersonate a High integrity token, so it won't help get past the access denied errors.&amp;nbsp; So, before it duplicates it back to LuaBuglight.exe, the helper process marks it as a Medium integrity token.&amp;nbsp; One side effect I discovered later is that the resulting token also has some of the more powerful privileges stripped.&amp;nbsp; The "this-user-as-admin" token does have "Administrators" enabled, but it is a Medium integrity token and with some admin privileges missing.&amp;nbsp; So, when the target program hits an access-denied or privilege-not-held error and the this-user-as-admin token is impersonated and the operation retried, it will succeed and be logged if the access-check depends on membership in Administrators or on any of the remaining privileges, but will fail if the access-check&amp;nbsp;requires&amp;nbsp;High IL&amp;nbsp;to succeed&amp;nbsp;or any of the missing privileges.&amp;nbsp; If the operation fails when impersonating the "this-user-as-admin" token, the operation is not logged, &lt;EM&gt;and&lt;/EM&gt; the app will see the access-denied error and possibly fail as a result.&lt;/P&gt;
&lt;P&gt;The next version of LUA Buglight will address this, somehow -- but I haven't decided how yet.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;4.&amp;nbsp; Network drive mappings:&lt;/STRONG&gt;&amp;nbsp; There were some issues involving network drive mappings that were posted as comments to the original LUA Buglight blog post.&amp;nbsp; I'm working on resolving those and will provide an update when I can.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1686542" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category></item><item><title>MSDN webcast:  LUA Buglight </title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/10/10/MSDN-webcast_3A00_--LUA-Buglight-.aspx</link><pubDate>Tue, 10 Oct 2006 19:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:813387</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/813387.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=813387</wfw:commentRss><description>&lt;P&gt;I'll be presenting an MSDN webcast and demoing &lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx"&gt;LUA Buglight&lt;/A&gt; next Tuesday, October 17, 2006, 11:00am US Pacific time.&lt;/P&gt;
&lt;P&gt;Click &lt;A class="" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032310777" mce_href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032310777"&gt;here&lt;/A&gt; for more information and to register.&amp;nbsp; Make sure to install the Microsoft LiveMeeting client prior to showtime.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;[Update, 18 Oct 2006]&amp;nbsp; &lt;/EM&gt;The webcast is now available for on-demand viewing &lt;A class="" href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032310778" target=_blank mce_href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032310778"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=813387" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category></item><item><title>LUA Buglight public [pre]-release</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/08/07/LuaBuglight.aspx</link><pubDate>Mon, 07 Aug 2006 23:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:691411</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>45</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/691411.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=691411</wfw:commentRss><description>&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;LUA Buglight&lt;/STRONG&gt;™ is a tool I've been working on that is designed to help both developers and IT Pros (sysadmins) identify the specific causes of &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx"&gt;&lt;FONT face=Arial&gt;"LUA bugs"&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; in desktop applications running on Windows XP, Windows Server 2003, or Windows Vista.&amp;nbsp; Once the specific causes have been identified, the bugs can more easily be resolved by fixing the app’s source code, or by making configuration changes, allowing the app to work correctly for non-admin users.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I have written a number of pieces about LUA bugs and how to fix them (see list below).&amp;nbsp; The problem has been that before you can fix them, you need to identify them.&amp;nbsp; The available tools for doing so have been lacking.&amp;nbsp; LUA Buglight exists to try to solve that problem.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;LUA Buglight remains a work in progress, but you can download the current version &lt;A href="http://blogs.msdn.com/aaron_margosis/attachment/691411.ashx" mce_href="http://blogs.msdn.com/aaron_margosis/attachment/691411.ashx"&gt;here&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Arial&gt;.&amp;nbsp; The download is a .zip file containing a self-extracting executable that simply extracts its contents to a folder of your choosing.&amp;nbsp; Those contents include a 34-page Word document -- please read it.&amp;nbsp; It should answer many of your questions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face=Arial&gt;One important note:&amp;nbsp; &lt;EM&gt;not every item that appears in the output indicates a bug that needs to be remediated!&amp;nbsp; &lt;/EM&gt;Before making any system changes, please refer to the following guidance:&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;What is a "LUA Bug"?&amp;nbsp; (And what isn't a LUA Bug?)&lt;BR&gt;&lt;/STRONG&gt;Not every "access denied" indicates a LUA bug! &lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx"&gt;&lt;FONT face=Arial&gt;http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;Fixing "LUA bugs", Part I&lt;BR&gt;&lt;/STRONG&gt;A systematic approach for working around LUA bugs that avoids unnecessary exposure &lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx"&gt;&lt;FONT face=Arial&gt;http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;Fixing "LUA bugs", Part II&lt;BR&gt;&lt;/STRONG&gt;A systematic approach for working around LUA bugs that avoids unnecessary exposure - the "rest of the story"&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/562091.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/562091.aspx"&gt;&lt;FONT face=Arial&gt;http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/562091.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;Changing Access Control on Folders vs. Files&lt;BR&gt;&lt;/STRONG&gt;More info on the risks of changing access control lists to fix LUA bugs.&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/638148.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/638148.aspx"&gt;&lt;FONT face=Arial&gt;http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/638148.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I’ll write more about LUA Buglight in the near future.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;[Updates:&amp;nbsp;&amp;nbsp; Oct 2006 &lt;/EM&gt;&lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2006/10/10/MSDN-webcast_3A00_--LUA-Buglight-.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/10/10/MSDN-webcast_3A00_--LUA-Buglight-.aspx"&gt;&lt;EM&gt;MSDN webcast&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;; and Feb 15 2007 &lt;/EM&gt;&lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2007/02/15/lua-buglight-updated-information.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2007/02/15/lua-buglight-updated-information.aspx"&gt;&lt;EM&gt;LUA Buglight updated information&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;]&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=+2&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color=red&gt;Update, November 6, 2008:&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; LUA Buglight 2.0 Second Preview is now available &lt;/EM&gt;&lt;A class="" href="http://blogs.msdn.com/aaron_margosis/archive/2008/11/06/lua-buglight-2-0-second-preview.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2008/11/06/lua-buglight-2-0-second-preview.aspx"&gt;&lt;EM&gt;here&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;.&amp;nbsp; Removing 1.0 from the download.&lt;BR&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=691411" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/LUA+Buglight/default.aspx">LUA Buglight</category></item><item><title>"Problems of Privilege: Find and Fix LUA Bugs" in TechNet Magazine</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/07/25/problems-of-privilege-find-and-fix-lua-bugs-in-technet-magazine.aspx</link><pubDate>Wed, 26 Jul 2006 00:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:678246</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/678246.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=678246</wfw:commentRss><description>&lt;FONT face=Arial size=2&gt;
&lt;P&gt;My ramblings have now been published in a more reputable venue than blogs.msdn.com.&amp;nbsp; Pick up the August 2006 issue of TechNet Magazine, or see it here on the web:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;A href="http://www.microsoft.com/technet/technetmag/issues/2006/08/LUABugs/" mce_href="http://www.microsoft.com/technet/technetmag/issues/2006/08/LUABugs/"&gt;Problems of Privilege: Find and Fix LUA Bugs&lt;/A&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;BTW, in the US you can subscribe to TechNet Magazine for free:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/technet/technetmag/subscribe.aspx" mce_href="http://www.microsoft.com/technet/technetmag/subscribe.aspx"&gt;http://www.microsoft.com/technet/technetmag/subscribe.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=678246" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category></item><item><title>Changing access control on folders vs. files</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/06/19/changing-access-control-on-folders-vs-files.aspx</link><pubDate>Tue, 20 Jun 2006 04:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:638148</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/638148.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=638148</wfw:commentRss><description>&lt;FONT size=2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;EM&gt;This post is the fourth installment&amp;nbsp;in the "Fixing LUA Bugs" series.&amp;nbsp; Before reading this, you should read:&lt;/EM&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx"&gt;&lt;EM&gt;What is a "LUA Bug"?&amp;nbsp; (And what isn't a LUA Bug?)&lt;/EM&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx"&gt;&lt;EM&gt;Fixing "LUA bugs", Part I&lt;/EM&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/562091.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/562091.aspx"&gt;&lt;EM&gt;Fixing "LUA bugs", Part II&lt;/EM&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;A fairly common LUA bug scenario is the application that creates and modifies files in the same folder as its executables.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;"&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'"&gt;C:\Program Files\VendorX\AppX.exe&lt;/SPAN&gt;" creating a file called "&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'"&gt;C:\Program Files\VendorX\InfoX.dat&lt;/SPAN&gt;" and writing to it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What are the risks for loosening permissions on the VendorX folder rather than just the InfoX.dat file?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What about loosening permissions on the folder and then re-establishing tighter permissions on the executables?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Consider the scenario of arbitrary malware having been executed by the interactively logged-on "User A" – perhaps because of a browser exploit or an IM- or email-based worm.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The malware runs in the context of the logged-on user.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If User A is a non-admin (and assuming no exploitable elevation-of-privilege vulnerabilities), the malware could control everything that User A sees and does, but should have no effect on other users of the computer or on the integrity of the operating system itself.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, User A cannot install a rootkit or other malware that runs when User B logs on; cannot change User B's Start menu items or the All Users' Start menu items; cannot change system executables such as cmd.exe or apps under Program Files.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The threat to consider here, therefore, is whether changing access controls for the shared app can enable the malware to compromise other users or the operating system.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Assuming User A already compromised and permissions on the AppX folder having been loosened, the risks increase as you move through the following scenarios:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 
5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: center" align=center&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;AppX or its data on ComputerA is used by:&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-ALIGN: center" align=center&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Resulting threat&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in"&gt;… User A (a single non-admin user)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid 
windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Negligible additional threat – the user's profile has already been compromised.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;AppX folder/files are one more thing that needs to be cleaned in order to prevent re-infection.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in"&gt;… multiple non-admin users&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid 
windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Attacker can use AppX/data as a vector to compromise other non-admin users, by causing arbitrary code to execute when AppX is used.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Each user who uses AppX is affected; operating system integrity is not compromised.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in"&gt;… a LocalSystem service or by a member of the Administrators group (or equivalent, including Power Users)&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid 
windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid 
windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Attacker can use AppX/data as a vector to gain admin/system privileges, by causing arbitrary code to execute when AppX is used.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Entire system can be completely compromised.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;It is easier to run arbitrary code by attacking executable code files than by attacking data files.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;"Executable code files" includes binary images such as .exe, .dll, and .ocx files, but also text files such as .cmd, .vbs, .js, .htm/.html/.mht, and even .xml (depending on how it is used).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is straightforward to directly modify executable files to include or invoke arbitrary commands of the attacker's choice.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;What if access is loosened on the application folder to allow creation of files or subfolders, but ACLs are applied directly to the executable files to prevent their modification?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That can prevent direct modification, which may frustrate and derail some attackers, but:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;If the application folder allows creation of new folders or files, an attacker can use &lt;A href="http://msdn.microsoft.com/library/en-us/dllproc/base/dynamic_link_library_redirection.asp" mce_href="http://msdn.microsoft.com/library/en-us/dllproc/base/dynamic_link_library_redirection.asp"&gt;DLL redirection&lt;/A&gt; to cause an application to load and execute substituted DLLs in place of shared DLLs without touching any existing files.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Files can be affected by making changes to their directory entries in the containing folder.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, loosened permissions on the application folder can allow the user to rename or delete a file in the folder – note that these are actually changes to the directory, not to the file – and then replace it with a Trojan.&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Generally speaking, executing arbitrary code by attacking data files is less straightforward.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A data file attack requires specific knowledge of the file format(s) involved, and how the application uses that data.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, it is not impossible.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, successful exploits have used malformed image files to cause buffer overruns in image-handling libraries on various platforms, and malformed document files against various productivity applications and suites.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In general, the more well-known the file formats (and application vulnerabilities) the more likely they are to be exploited.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, targeted attacks can be mounted against any vulnerable application.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;It is always best to avoid loosening access control on shared resources whenever possible.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So always consider:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Does the application really need access to that object?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, if the application can't write to a log file it maintains in its application folder, does the application continue to work correctly anyway?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If so, then it's not a true LUA bug, so don't try to fix it.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Is the data file accessed through the "Ini File" APIs?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If so, an IniFileMapping entry might fix the problem by redirecting access to per-user registry keys.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For this reason, LUA Buglight &lt;EM&gt;[URL coming soon!]&lt;/EM&gt;&amp;nbsp;distinguishes "Ini File" API access separately from file access issues.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;The LUA shims of the Application Compatibility Toolkit may obviate the need for any access control changes.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;[and other mitigations described in the earlier "Fixing LUA Bugs" posts.]&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;As mentioned, given the choice between loosening access for a file or for its containing folder, it is always preferable to do so for the file.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, if the file does not already exist, the application will need permission on the containing folder to create the file – you can't set permissions on an object that doesn't exist.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You may be able to get around this issue by pre-creating the file and setting the necessary permissions on it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If it turns out that the application regularly deletes and then re-creates the file, a further trick that might work is to pre-create the file and grant the application user the ability to write to the file, but not to delete it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Many apps won't bother to verify that the deletion succeeded, and will clear the contents of the file on subsequent access anyway.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These tricks will not work, however, for cases where the application creates a temporary, randomly-named file for edits, then deletes the original and renames the temporary file to the name of the original.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;In summary:&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Changing access control on shared resources should be avoided if at all possible – investigate alternatives first.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Grant the least amount of additional access to the smallest possible number of resources.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Loosening access on specific data files is greatly preferred to loosening access on folders.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list 
.5in"&gt;Avoid loosening access on executable code files.&lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=638148" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category></item><item><title>Fixing "LUA Bugs", Part II</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/03/27/fixing-lua-bugs-part-ii.aspx</link><pubDate>Mon, 27 Mar 2006 19:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:562091</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>34</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/562091.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=562091</wfw:commentRss><description>&lt;DIV class=Section1&gt;&lt;FONT size=2&gt;
&lt;H2&gt;&lt;FONT face=Arial&gt;Fixing "LUA bugs", Part II&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;If (&lt;I&gt;and only if&lt;/I&gt;) items #1 through #3 (a, b and c) from &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/533077.aspx"&gt;&lt;FONT face=Arial&gt;Fixing LUA bugs, Part I&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; don’t allow your apps to work as normal user, then – &lt;I&gt;and only then&lt;/I&gt; – move on to items #4 and #5, which are described in this article, along with their respective benefits and drawbacks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 13.5pt"&gt;&lt;FONT face=Arial&gt;#4:&amp;nbsp; Loosen ACLs&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;The usual reason for LUA bugs is that the developers (and often, the testers) always ran as admin.&amp;nbsp; They didn’t explicitly set out to require that the end-user run as admin, but things crept into the code that depended on admin access, such as writing to files in the root folder of the C: drive, in the app’s installation folder under %ProgramFiles%, or in %windir%.&amp;nbsp; The app worked correctly until you ran it on &lt;I&gt;your&lt;/I&gt; machine as a regular User.&amp;nbsp; The app wasn’t designed to handle that scenario gracefully, and barfed.&amp;nbsp; (See &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx"&gt;&lt;FONT face=Arial&gt;What is a LUA Bug…&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;).&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;Option #4 is to change the Access Control List (ACL) on objects to grant your User the access that the program requires.&amp;nbsp; Typically the objects that need tweaking will be in the registry or in the file system (if using NTFS).&amp;nbsp; This must be done very carefully, though, and only after all of the more-preferred options have failed.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Constraints:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;App-specific resources only:&amp;nbsp; &lt;/B&gt;ACL changes should only ever be considered on &lt;I&gt;application-specific&lt;/I&gt; resources, not on OS-wide resources.&amp;nbsp; While it &lt;I&gt;might&lt;/I&gt; be OK to change the ACL on &lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;%ProgramFiles%\VendorX\AppX\DataFolder&lt;/SPAN&gt;, you should never change the ACL on &lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;%SystemRoot%\System32&lt;/SPAN&gt; – to loosen &lt;I&gt;or&lt;/I&gt; to tighten access.&amp;nbsp; (See &lt;/FONT&gt;&lt;A href="http://support.microsoft.com/default.aspx/kb/885409" mce_href="http://support.microsoft.com/default.aspx/kb/885409"&gt;&lt;FONT face=Arial&gt;KB article 885409&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; for more information.)&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=2&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;Not used by admins:&amp;nbsp; &lt;/B&gt;Avoid changing ACLs on resources – particularly executables such as .exe and .dll files – that are ever used by administrators or services.&amp;nbsp; Doing so increases the risk of elevation of privilege leading to compromise of the entire system.&amp;nbsp; (Even so, the attack surface would remain far smaller than it would be with everything always running as admin.)&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=3&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;Avoid binaries:&lt;/B&gt;&amp;nbsp; Avoid changing ACLs on program code (e.g., exe, dll, or ocx files) if at all possible, to prevent malware from infecting or replacing them.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=4&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;Single non-admin user (ideal):&amp;nbsp; &lt;/B&gt;&lt;I&gt;Ideally&lt;/I&gt;, the resource should be one that is only ever accessed by a single non-admin user.&amp;nbsp; If the resource is accessed by multiple non-admin users, there is increased risk of one user causing another user’s account to be compromised.&amp;nbsp; As described above, if it is ever used by an admin user or a service, risks are increased further.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=5&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;Least additional privilege:&amp;nbsp; &lt;/B&gt;You should grant the least amount of additional access to the smallest possible number of resources and to the smallest possible number of users in order to allow the app to work.&amp;nbsp; Granting Full Control to Everyone on a big chunk of the file system or registry should never be necessary.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Granting the additional access only to the computer’s primary user is optimal, but that may be difficult to manage across a large number of systems when each computer has a different primary user (e.g., grant MARY the permissions on one system, STEVE on another, etc).&amp;nbsp; If you can define a set of users who need to use the program, add them to a group and grant the access to that group.&lt;BR&gt;&lt;BR&gt;Another alternative to consider is to grant access to the built-in INTERACTIVE pseudo-group.&amp;nbsp; This will grant the additional access only to whoever is interactively logged on at the time, without also granting any additional remote access to the resource.&amp;nbsp;&amp;nbsp; Note that in a terminal server or Fast User Switching scenario there can be multiple simultaneous users on the computer with INTERACTIVE in their tokens.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Benefits of this approach:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;Big return on the investment of your time – most of the LUA bugs that my colleagues and I have seen revolve around file and registry permissions.&amp;nbsp; This approach will probably fix a larger share of your LUA bugs than any other approach.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Drawbacks to this approach:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;It’s #4 on the list for a reason.&amp;nbsp; This approach allows otherwise-constrained users to change shared resources – for good or evil, and makes it easier for one user (or malware unintentionally run by that user) to affect others.&amp;nbsp; If the affected user is an admin, the entire system can be compromised.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=2&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;As with items #3a and 3b, it is not easy, with today’s tools, to identify precisely which resources should be opened up and by how much.&amp;nbsp; (More on this in upcoming posts.)&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=3&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;It can be difficult to know for certain whether opening access to a resource will inadvertently expose an avenue for elevation of privilege, allowing system takeover.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 13.5pt"&gt;&lt;FONT face=Arial&gt;#5:&amp;nbsp; Run the one app with elevated privileges&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;As a last resort, after all else fails, consider running that one app with elevated groups and/or privileges.&amp;nbsp; Some apps, for example, “address” their LUA bugs by explicitly checking for admin group membership on startup and displaying an error message insisting that you simply have to be an admin to use the program.&amp;nbsp; This may be due to developer laziness, incompetence or arrogance (or all three), but these apps will be resistant to any other workarounds available to you.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;Typically, this approach means running the app as admin.&amp;nbsp; You could instead run the app elevated but less-than-full-admin – for example, as a member of Power Users or with a specific privilege such as SeLoadDriverPrivilege.&amp;nbsp; Note, though, that with a little more work many of these other groups and privileges can still be used to take over an entire system.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Benefits of this approach:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;It’s better than always running everything as admin.&amp;nbsp; That’s it – that is the only benefit of this approach.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Drawbacks of this approach:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;Running an app with elevated privileges exposes far more risk than any of the options described earlier.&amp;nbsp; It becomes very difficult to defend the system against a malicious user or malicious software when there’s an app running as admin.&amp;nbsp; A simple example:&amp;nbsp; Run “Notepad” as admin, then choose File/Open – that dialog is now a little Explorer-like window that gives you full, admin-level access to the entire file system, and even the ability to launch programs as admin.&amp;nbsp; That can be exploited by a malicious user, or by malware pumping keystrokes or window messages into the elevated program.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;How to do it:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;If you trust the user with the admin password&lt;/B&gt; or to otherwise make security and trust decisions:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;&lt;I&gt;RunAs&lt;/I&gt;&lt;/B&gt; – see &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2004/06/23/163229.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2004/06/23/163229.aspx"&gt;&lt;FONT face=Arial&gt;"RunAs" basic (and intermediate) topics&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; and &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2004/07/07/175488.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2004/07/07/175488.aspx"&gt;&lt;FONT face=Arial&gt;RunAs with Explorer&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; for more information.&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;B&gt;&lt;I&gt;MakeMeAdmin&lt;/I&gt;&lt;/B&gt; – see &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/193721.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/193721.aspx"&gt;&lt;FONT face=Arial&gt;the original post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; and &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2005/03/11/394244.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2005/03/11/394244.aspx"&gt;&lt;FONT face=Arial&gt;this follow-up&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;. &amp;nbsp;MakeMeAdmin is a batch file, so you can easily customize it to run something other than a command shell.&amp;nbsp; You can also customize it to make the elevated context less than full-admin.&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;A href="http://www.sysinternals.com/Utilities/PsExec.html" mce_href="http://www.sysinternals.com/Utilities/PsExec.html"&gt;&lt;FONT face=Arial&gt;PsExec&lt;/FONT&gt;&lt;/A&gt;&lt;/I&gt;&lt;/B&gt;&lt;FONT face=Arial&gt; and &lt;B&gt;&lt;I&gt;&lt;A href="http://www.sysinternals.com/Utilities/ProcessExplorer.html" mce_href="http://www.sysinternals.com/Utilities/ProcessExplorer.html"&gt;Process Explorer&lt;/A&gt;&lt;/I&gt;&lt;/B&gt; from &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/" mce_href="http://www.sysinternals.com/"&gt;&lt;FONT face=Arial&gt;SysInternals&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; offer various RunAs-like options.&amp;nbsp; See Mark’s &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/blog/2006/03/running-as-limited-user-easy-way.html" mce_href="http://www.sysinternals.com/blog/2006/03/running-as-limited-user-easy-way.html"&gt;&lt;FONT face=Arial&gt;blog post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; for more information.&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;A href="http://www.harper.no/valery/PermaLink,guid,99b85fa3-104f-4a41-a28f-4786c68e77e4.aspx" mce_href="http://www.harper.no/valery/PermaLink,guid,99b85fa3-104f-4a41-a28f-4786c68e77e4.aspx"&gt;&lt;FONT face=Arial&gt;RunAsAdmin&lt;/FONT&gt;&lt;/A&gt;&lt;/I&gt;&lt;/B&gt;&lt;FONT face=Arial&gt;, an interesting &lt;/FONT&gt;&lt;A href="http://sourceforge.net/projects/runasadmin" mce_href="http://sourceforge.net/projects/runasadmin"&gt;&lt;FONT face=Arial&gt;open-source&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; utility by &lt;/FONT&gt;&lt;A href="http://www.harper.no/valery/" mce_href="http://www.harper.no/valery/"&gt;&lt;FONT face=Arial&gt;Valery Pryamikov&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;, a very smart Developer Security MVP.&amp;nbsp; RunAsAdmin takes an approach a little like &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/technet/windowsvista/security/uac.mspx" mce_href="http://www.microsoft.com/technet/windowsvista/security/uac.mspx"&gt;&lt;FONT face=Arial&gt;Windows Vista’s UAC&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;, elevating the current user in place without requiring a password.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;If you don’t trust the user with the admin password:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;A href="http://www.desktopstandard.com/PolicyMakerApplicationSecurity.aspx" mce_href="http://www.desktopstandard.com/PolicyMakerApplicationSecurity.aspx"&gt;&lt;FONT face=Arial&gt;PolicyMaker Application Security&lt;/FONT&gt;&lt;/A&gt;&lt;/I&gt;&lt;/B&gt;&lt;FONT face=Arial&gt; by &lt;/FONT&gt;&lt;A href="http://www.desktopstandard.com/" mce_href="http://www.desktopstandard.com/"&gt;&lt;FONT face=Arial&gt;DesktopStandard&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; uses a Group Policy extension to configure rules for modifying process tokens.&amp;nbsp; PMAS mitigates some of the drawbacks described above.&amp;nbsp; For example, it can be configured so that child processes launched by a targeted app do not inherit its modified token, and can perform granular token modification, raising (or lowering) permissions, and/or adding (or removing) privileges.&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;A href="http://www.winternals.com/Products/ProtectionManager/Default.aspx" mce_href="http://www.winternals.com/Products/ProtectionManager/Default.aspx"&gt;&lt;FONT face=Arial&gt;Protection Manager&lt;/FONT&gt;&lt;/A&gt;&lt;/I&gt;&lt;/B&gt;&lt;FONT face=Arial&gt; by &lt;/FONT&gt;&lt;A href="http://www.winternals.com/" mce_href="http://www.winternals.com/"&gt;&lt;FONT face=Arial&gt;Winternals&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; (the for-profit side of &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/" mce_href="http://www.sysinternals.com/"&gt;&lt;FONT face=Arial&gt;SysInternals&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;) uses a lightweight client-server application and a whitelist approach to block all untrusted applications – while also allowing applications that to have their process tokens and privileges elevated to that of an Administrator or reduced to that of a User (in cases where end users are non-Administrators or Administrators, respectively). &amp;nbsp;Protection Manager also doesn’t allow a child process of an elevated app to run elevated unless it is also explicitly configured as an elevated app.&amp;nbsp; Conversely, all process children of reduced privilege processes are reduced automatically (to also minimize security risk). Applications can be allowed, blocked, elevated, or reduced as specified by an administrator via Digital Signatures, Hashes, NTFS File Ownership, or Path.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face=Arial&gt;Trying to "hide" the admin password:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;The DesktopStandard and Winternals products determine in kernel-mode code whether, when and how to modify a process token.&amp;nbsp; Passwords are not used and are therefore not at risk to exposure, and the modification decision cannot be interfered with by non-admins.&amp;nbsp; By contrast, there are various tools available that perform RunAs-like operations with the admin account credentials encrypted (or sometimes just obfuscated).&amp;nbsp; Even though this raises the bar and will stop some users from getting the admin creds, those passwords still have to be decrypted within the user’s security context, and so are exposed to a user with the right tools.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;A frequently asked question is whether the RunAs.exe /savecred option would let one create a shortcut to run a single app as admin using a saved password and not requiring further password entry.&amp;nbsp; There are several issues you should be aware of:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;The credentials are not tied to any one shortcut – once the creds have been saved they can be used to start any app&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;While the password is securely encrypted with a user-specific key, it will still be decrypted in the user’s security context and at least briefly exposed&lt;/FONT&gt; 
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;The /savecred option is not available on XP Home Edition.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;//TODO:&amp;nbsp; Discuss my thoughts about the SRP/DropMyRights approach.&amp;nbsp; (Bottom line:&amp;nbsp; I dislike it.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial&gt;Much thanks for help and insight for this post goes to Eric Voskuil and Kevin Sullivan of DesktopStandard, and to Mark Russinovich and Wes Miller of Sysinternals/Winternals.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=562091" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category></item><item><title>Fixing "LUA bugs", Part I</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/02/16/fixing-lua-bugs-part-i.aspx</link><pubDate>Thu, 16 Feb 2006 11:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:533077</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>49</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/533077.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=533077</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You have an application that you – or your users – need to run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s a normal app – it isn’t designed to perform system administration of your computer, but for some reason, it doesn’t work correctly unless it’s run from an account that has administrator-level access (see “&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/525455.aspx"&gt;What is a "LUA Bug"? (And what isn't a LUA bug?)&lt;/A&gt;”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But you don’t want your users running as admin.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What to do?&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The “workaround” most frequently chosen is simply to add the user to the Administrators group.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Sometimes this approach is not decided by the IT department, but by some “helpful” HelpDesk technician:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;“Let’s see whether this fixes the problem.”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The technician forgets to remove you from the Admins group, inevitably leading to another HelpDesk call within a few weeks:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;“HelpDesk, why is my computer running so slowly, and why are all these porn ads popping up whenever I log on?”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(Answer:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Because you’ve been running as admin!)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Let’s just call this “workaround” a non-starter and not give it any further consideration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Other common but &lt;I style="mso-bidi-font-style: normal"&gt;sub-optimal&lt;/I&gt; workarounds are:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;1) run the one program as administrator, or 2) run the program as a regular user, but after granting Everyone “Full Control” over the program’s installation folder and all of its registry keys under HKEY_LOCAL_MACHINE, and to all of HKEY_CLASSES_ROOT.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Oh, and while we’re at it, grant the user the “Debug”, “Take ownership” and “Act as part of the operating system” privileges.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are seriously high-risk ways to get the program to run, and should be avoided.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So what do you do?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In this mini-series of posts, I’ll lay out a systematic approach for working around LUA bugs that minimizes exposure.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll discuss approaches from most-preferred to least-preferred, with some of the pros and cons of each.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;By the way, while this guidance is targeted primarily to Windows XP, it will also work on Windows Vista.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;FONT size=4&gt;#1:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is a bug – treat it like one and make the developers fix it!&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is the most preferred approach.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If there is no &lt;I style="mso-bidi-font-style: normal"&gt;legitimate&lt;/I&gt; business or technical reason for the app to require admin privileges, then failure of the app to work for a regular user account is a serious bug that compromises system security, stability and manageability.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(Note:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;if the development team says something like “It’s mission-critical, so it has to run as admin”, or “it writes to HKEY_LOCAL_MACHINE, so it has to run as admin”, the correct response from you is, “You’re talking nonsense.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Fix the bug!”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Benefits of this approach:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l6 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Once it is fixed this way, you don’t need to carry forward any shims, tweaks or workarounds.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l6 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Developers may learn from the experience, and stop creating new LUA bugs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(Note:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Developers running as admin are the #1 cause of LUA bugs!)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;There are some drawbacks, though:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The expense in time and/or money may be prohibitive, particularly if you have limited resources and a lot of apps to fix.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You have to consider the possibility of the app having to be rearchitected, and the possibility of new bugs being introduced in the process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo2; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The developers and/or the source code may not be available.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It may be 3&lt;SUP&gt;rd&lt;/SUP&gt; party code from a company that no longer exists.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The developers may be in rehab.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Or jail.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Or working for your competitor.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Or they may be working on something “more important”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;FONT size=4&gt;#2:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; Application Compatibility Toolkit&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Use the LUA Mode shims of the Application Compatibility Toolkit (ACT).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(File and Registry Virtualization is the equivalent solution built into Windows Vista.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The LUA Mode shims detect attempts to write to system-wide locations in the file system and registry and silently redirect them to per-user locations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Benefits of this approach:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l5 level1 lfo3; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;It is easy to implement&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Drawbacks:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l2 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The LUA Mode shims on XP often do not work (&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:place w:st="on"&gt;Vista&lt;/st1:place&gt;’s Virtualization is a complete rewrite and will have much higher compatibility marks than XP’s ACT LUA Modes.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l2 level1 lfo4; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The added complexity of the resulting underlying operations can make your troubleshooting more complicated when things don’t work.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The next 3 items (3a, 3b and 3c) are system changes that solve different specific issues, but share the common feature of not granting any elevated access to system-wide resources.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;FONT size=4&gt;#3a:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Copy specific HKCR keys to HKCU\Software\Classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(Registry notations used here:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;HKLM = HKEY_LOCAL_MACHINE; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;HKCR = HKEY_CLASSES_ROOT; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;HKCU = HKEY_CURRENT_USER)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Some background:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Prior to Windows 2000, &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCR&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; was just a symbolic link to &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKLM\Software\Classes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;, which only Administrators can write to.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In other words, operations performed on &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCR\.txt&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; would actually occur in &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKLM\Software\Classes\.txt&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows 2000 introduced per-user registration data, so now &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCR&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; is a &lt;I style="mso-bidi-font-style: normal"&gt;merged view&lt;/I&gt; of &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKLM\Software\Classes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; and &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCU\Software\Classes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; (which the user &lt;I style="mso-bidi-font-style: normal"&gt;can&lt;/I&gt; write to).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If a key exists in the latter, it takes precedence.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So now an operation on &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCR\.txt&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; will occur in &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCU\Software\Classes\.txt&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; &lt;I style="mso-bidi-font-style: normal"&gt;if that key already exists&lt;/I&gt;, otherwise it will occur in &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKLM\Software\Classes\.txt&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; as it had in the past.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The issue to fix:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A number of applications write to HKCR at runtime to “reinforce” their file associations, COM registration data, etc., and raise an error if the write fails, even if the data they want to write is already there.&amp;nbsp; The same data is written every time the app runs.&amp;nbsp; If that same registration data were stored in &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKCU\Software\Classes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;, then the write operations would succeed, without changing program behavior.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;How to fix it:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;First you must identify the keys under HKCR that the application is trying to write to.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(How to do that will be covered in later posts.)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Export those keys to one or more &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;.reg &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;files (in Regedit, use File/Export, Selected branch).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Using a text editor, replace all instances of&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;[HKEY_CLASSES_ROOT\&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;with&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;[HKEY_CURRENT_USER\Software\Classes\&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;and save your changes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Import the edited .reg file into the registry of the user who needs to run the program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Benefits of this approach:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l3 level1 lfo5; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This fixes issues where applications perform operations in HKCR that should have been done only during installation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l3 level1 lfo5; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This approach is better than loosening access control on system-wide resources under HKCR (HKLM).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Malware overwriting keys under HKCU will not affect operating system components or other users of the computer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Drawbacks:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l7 level1 lfo6; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;It is not easy, with today’s tools, to identify HKCR writes as the source of LUA bugs, and exactly which keys are involved.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(More on this in upcoming posts.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;FONT size=4&gt;#3b:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;IniFileMapping&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Background:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Back in the days of Windows 3.x, before there was the Registry that we know and love, the OS and applications stored configuration and preference data to &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;.ini&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; (initialization) files, such as &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;win.ini&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Windows did and still does offer API-level support for .ini files via the “Profile” APIs (e.g., &lt;A href="http://msdn.microsoft.com/library/en-us/sysinfo/base/writeprivateprofilestring.asp" mce_href="http://msdn.microsoft.com/library/en-us/sysinfo/base/writeprivateprofilestring.asp"&gt;WritePrivateProfileString&lt;/A&gt;).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Many apps (including &lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2005/02/09/370264.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2005/02/09/370264.aspx"&gt;some Windows applets&lt;/A&gt;) still use these APIs to try to write to .ini-formatted files, often in folders where Users are not supposed to write.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Windows NT 3.1 encouraged the migration from .ini files to the more scalable and manageable Registry, and provided a means for automatically redirecting .ini file reads and writes to registry keys.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The internal implementation of the “Profile” APIs was augmented to use mappings found under &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If a mapping for a .ini file is not found under that key, then the operation is performed in the file system as before.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The issue to fix:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;If access to an .ini-formatted file – via the “Profile” APIs – is the cause of a LUA bug, it can be remediated by adding a key under the IniFileMapping key to redirect access to HKCU.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note that IniFileMapping is under HKLM and requires administrative privileges to configure.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The config specifics are described in the documentation for the “Profile” APIs, such as &lt;A href="http://msdn.microsoft.com/library/en-us/sysinfo/base/writeprivateprofilestring.asp" mce_href="http://msdn.microsoft.com/library/en-us/sysinfo/base/writeprivateprofilestring.asp"&gt;WritePrivateProfileString&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Benefits of this approach:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l4 level1 lfo7; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This approach is better than loosening access control on system-wide resources in the file system.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Malware overwriting keys under HKCU will not affect operating system components or other users of the computer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Drawbacks:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l1 level1 lfo8; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;It is not easy, with today’s tools, to identify .ini-file access as the source of LUA bugs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(More on this in upcoming posts.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;FONT size=4&gt;#3c:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;SafeDisc&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;A number of games depend on the “secdrv” device driver, also known as “SafeDisc”, from Macrovision.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The secdrv driver that ships with Windows XP is a demand-start driver, which users are not allowed to stop and start, resulting in errors when accessed by programs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is an update, available from &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=eae20f0f-c41c-44fe-84ce-1df707d7a2e9&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=eae20f0f-c41c-44fe-84ce-1df707d7a2e9&amp;amp;displaylang=en"&gt;Microsoft&lt;/A&gt; and from &lt;A href="http://www.macrovision.com/products/safedisc/downloads.shtml" mce_href="http://www.macrovision.com/products/safedisc/downloads.shtml"&gt;Macrovision&lt;/A&gt; that configures the driver to be loaded when the system starts so that the user does not need to start it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This change allows some games to work correctly for a non-admin user.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(Note that as of this writing, the Microsoft download page for this update says that “[t]his software will not alter or patch any component on your system, it will only change the startup state of the system component…”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is actually not true – it installs an updated driver.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Benefits:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Easy to implement, and no ACL changes to systemwide resources.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Drawbacks:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;None, really.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Coming up in Part 2:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;#4:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Loosening specific ACLs, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;#5:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Running the one app as admin&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=533077" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category></item><item><title>What is a "LUA Bug"?  (And what isn't a LUA bug?)</title><link>http://blogs.msdn.com/aaron_margosis/archive/2006/02/06/what-is-a-lua-bug-and-what-isn-t-a-lua-bug.aspx</link><pubDate>Mon, 06 Feb 2006 09:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:525455</guid><dc:creator>Aaron Margosis</dc:creator><slash:comments>37</slash:comments><comments>http://blogs.msdn.com/aaron_margosis/comments/525455.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aaron_margosis/commentrss.aspx?PostID=525455</wfw:commentRss><description>&lt;DIV class=Section1&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;First, what is "LUA"?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;"LUA" is an acronym that variously refers to "Limited User Account", "Least-privileged User Account", "Least User Access", and probably several other clumsy phrases that ultimately indicate a computer user account that cannot make changes that affect other users of the system or the operating system itself.&amp;nbsp; In Windows, these are typically members of the built-in "Users" group; they are explicitly &lt;I&gt;not&lt;/I&gt; members of powerful groups such as "Administrators", Power Users", or "Backup Operators", and do not hold elevated privileges such as "Load and unload device drivers," "Take ownership of files or other objects," or "Act as part of the operating system".&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;A "LUA bug," then, refers to an application -- or a feature of an application -- that works correctly when run with elevated privileges but fails to work for a LUA user, &lt;I&gt;and&lt;/I&gt; where there is no technical or business reason for requiring elevated privileges.&amp;nbsp; A common example is when an application saves its runtime settings to a registry key under HKEY_LOCAL_MACHINE (which is read-only to LUA users), instead of to HKEY_CURRENT_USER.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;Windows doesn't allow LUA users to change the system time.&amp;nbsp; That is not a LUA bug, because changing the system time has security implications with respect to auditing and to the Kerberos protocol.&amp;nbsp; The fact that Windows XP doesn't allow LUA users to change the time zone is arguably a LUA bug, as is the fact that double-clicking the clock in the taskbar's notification area gives you an error message instead of a read-only view of the Date&amp;amp;Time applet.&amp;nbsp; (Note 1:&amp;nbsp; Vista is heavily focused on a more seamless LUA experience -- see the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/uac/" mce_href="http://blogs.msdn.com/uac/"&gt;&lt;FONT face=Arial size=2&gt;UAC blog&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt; for more info -- and the Date&amp;amp;Time applet is a primary target for an upgraded experience.&amp;nbsp; Note 2:&amp;nbsp; I wrote &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/aaron_margosis/archive/2005/02/11/371474.aspx" mce_href="http://blogs.msdn.com/aaron_margosis/archive/2005/02/11/371474.aspx"&gt;&lt;FONT face=Arial size=2&gt;an earlier post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt; about how to grant a Windows XP user the ability to change the date, time and/or time zone.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;By far, the majority of LUA bugs are due to registry and file system access.&amp;nbsp;&amp;nbsp; A program might try to save its settings into its installation folder under %ProgramFiles%, or it might try to open a key under HKLM for "All-Access" even if it only ever needs Read access.&amp;nbsp; However, there are other types of LUA bugs:&amp;nbsp; attempting to start or stop a service, load a device driver, access hardware resources directly, create or manage file shares, or even explicitly check whether the current user is a member of the Administrators group.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;At the core, there are always one or more low-level operations ("API calls") that succeed when performed as admin but that fail when performed as LUA.&amp;nbsp; You can see some of these yourself using tools such as &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/" mce_href="http://www.sysinternals.com/"&gt;&lt;FONT face=Arial size=2&gt;SysInternals&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;' &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/Utilities/Regmon.html" mce_href="http://www.sysinternals.com/Utilities/Regmon.html"&gt;&lt;FONT face=Arial size=2&gt;Regmon&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt; and &lt;/FONT&gt;&lt;A href="http://www.sysinternals.com/Utilities/Filemon.html" mce_href="http://www.sysinternals.com/Utilities/Filemon.html"&gt;&lt;FONT face=Arial size=2&gt;Filemon&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;.&amp;nbsp; However, is every one of these a real LUA bug?&amp;nbsp; The answer is that it depends on how the application responds to the failure.&amp;nbsp; The responses I have seen can be categorized in one of three ways:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;I&gt;"Fire and forget"&lt;/I&gt;:&amp;nbsp; The application invokes the operation, doesn't check the result,&amp;nbsp;but doesn't depend on the operation having succeeded in order to continue working correctly.&amp;nbsp; &lt;I&gt;&lt;STRONG&gt;This is not a LUA bug.&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;I&gt;"Gracefully degrade"&lt;/I&gt;:&amp;nbsp; The application invokes the operation, checks whether it succeeded, and handles failure in an appropriate way.&amp;nbsp; &lt;I&gt;&lt;STRONG&gt;This is not a LUA bug.&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;
&lt;LI class=MsoNormal&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;I&gt;"True LUA bug"&lt;/I&gt;:&amp;nbsp; The application invokes the operation, assumes it succeeded, and &lt;I&gt;depends on the operation having succeeded&lt;/I&gt; in order to continue working correctly.&amp;nbsp; A variation on this is that the app checks whether the operation succeeded, but handles the failure inappropriately, such as by displaying an error message and falling over dead.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;If you've ever monitored a GUI app running as LUA with Regmon, you've probably come across an example that could be categorized as fire-and-forget:&amp;nbsp; a failed attempt to open &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'"&gt;HKLM \ System \ CurrentControlSet \ Control \ MediaProperties \ PrivateProperties \ Joystick \ Winmm&lt;/SPAN&gt; for All-Access.&amp;nbsp; This occurs during initialization of the joystick subsystem for the process.&amp;nbsp; The specific operation fails, but it does not impact the correct behavior of your application.&amp;nbsp; However, I have seen "guidance" on the web (no doubt from people misinterpreting Regmon output) claiming that to fix some particular application you need to grant the user full access to this key.&amp;nbsp; No!&amp;nbsp; It's not a true LUA bug.&amp;nbsp; You should never need to change permissions on this key!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;Before you go making wholesale changes to security settings, you should verify that you're remediating a true LUA bug and not just a phantom, and that there aren't better ways that don't increase exposure.&amp;nbsp; More on that in upcoming posts.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=525455" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Non-admin/default.aspx">Non-admin</category><category domain="http://blogs.msdn.com/aaron_margosis/archive/tags/Fixing+LUA+Bugs/default.aspx">Fixing LUA Bugs</category></item></channel></rss>