<?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>The What, Why and How of Software Security :    Authorization   </title><link>http://blogs.msdn.com/varun_sharma/archive/tags/+++Authorization+++/default.aspx</link><description>Tags:    Authorization   </description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How To: Configure permissions in Out-of-the-box MOSS 2007 Approval Workflow such that “Approvers” cannot edit or delete the item to be approved</title><link>http://blogs.msdn.com/varun_sharma/archive/2008/08/04/how-to-configure-permissions-in-out-of-the-box-moss-2007-approval-workflow-such-that-approvers-cannot-edit-or-delete-the-item-to-be-approved.aspx</link><pubDate>Mon, 04 Aug 2008 14:01:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8830213</guid><dc:creator>Varun Sharma</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/varun_sharma/comments/8830213.aspx</comments><wfw:commentRss>http://blogs.msdn.com/varun_sharma/commentrss.aspx?PostID=8830213</wfw:commentRss><description>&lt;p&gt;1. Consider a Microsoft Office SharePoint Server 2007 site that will be used as a “Document Approval System”. Certain users will be “Editors” and they will be able to upload documents for approval. Another set of users will be “Approvers”. These users can either approve or reject the uploaded documents. The security requirement is that “&lt;u&gt;Editors” should not be able to approve the documents&lt;/u&gt; and the “&lt;u&gt;Approvers” should not be able to edit or delete the documents&lt;/u&gt;. &lt;/p&gt;  &lt;p&gt;2. Create a document library where the documents will be uploaded. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="392" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image002_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this document library, create an Out-of-the-box MOSS 2007 Approval Workflow. In the “Select a task list to use with this workflow”, select “New task list”. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image004_2.jpg"&gt;&lt;img title="clip_image004" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="328" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image004_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. In the text box for “Approvers”, add the windows group that will contain all the “Approver” users. Also so that an editor cannot change this “Approver” group at the time the workflow is being created, uncheck the “Allow changes to the participant list when this workflow is started” checkbox. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image006_2.jpg"&gt;&lt;img title="clip_image006" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="390" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image006_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. As you can see a new task list is created for this workflow. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image008_2.jpg"&gt;&lt;img title="clip_image008" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image008_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Give Contribute permissions on the site to the windows group that will contain the “Editors”. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image010_2.gif"&gt;&lt;img title="clip_image010" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="413" alt="clip_image010" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image010_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This group can now add, edit and delete items from lists. &lt;/p&gt;  &lt;p&gt;6. Now login as an “Editor” and upload a document. &lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image012_2.gif"&gt;&lt;img title="clip_image012" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="205" alt="clip_image012" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image012_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Start the workflow on the uploaded document. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image014_2.gif"&gt;&lt;img title="clip_image014" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="clip_image014" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image014_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see the approvers text box is disabled.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image016_2.jpg"&gt;&lt;img title="clip_image016" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="473" alt="clip_image016" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image016_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once the workflow is started, a task is created in the task list specific to this workflow. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image018_2.gif"&gt;&lt;img title="clip_image018" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="182" alt="clip_image018" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image018_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Let us see what happens if the “Editor” tries to approve the document herself. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image020_2.jpg"&gt;&lt;img title="clip_image020" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="291" alt="clip_image020" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image020_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We are trying to approve a workflow logged in as an editor. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image022_2.jpg"&gt;&lt;img title="clip_image022" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="clip_image022" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image022_thumb.jpg" width="624" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The “Editor” will get an &lt;u&gt;error message&lt;/u&gt; and the following will be added to the workflow history. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image024_2.jpg"&gt;&lt;img title="clip_image024" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="413" alt="clip_image024" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image024_thumb.jpg" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. Now login as the “Administrator” and create a new permission level for the “Approver”. Give this permission level, edit items, view items, open items, view versions and view application pages permissions. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image026_2.gif"&gt;&lt;img title="clip_image026" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="411" alt="clip_image026" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image026_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. Create a new Share Point group for workflow approvers. Give it read permissions on the site. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image028_2.gif"&gt;&lt;img title="clip_image028" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="257" alt="clip_image028" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image028_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image030_2.gif"&gt;&lt;img title="clip_image030" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="176" alt="clip_image030" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image030_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Give the same group edit permissions on the workflow task list (that was specifically created for the approval workflow) using the “WorkflowApprovalPerm” permission just created. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image032_2.gif"&gt;&lt;img title="clip_image032" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="251" alt="clip_image032" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image032_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image034_2.gif"&gt;&lt;img title="clip_image034" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="330" alt="clip_image034" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image034_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The Share Point group “Workflow Approvers” now has the following effective permissions on the site. Effectively it has read-only permissions on the entire site, but “edit” permissions on the task list specific to the approval workflow. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image036_2.gif"&gt;&lt;img title="clip_image036" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="162" alt="clip_image036" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image036_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Add the windows group containing all the approvers to this “Workflow Approvers” Share Point group. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image038_2.gif"&gt;&lt;img title="clip_image038" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="299" alt="clip_image038" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image038_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Now login as an “Approver”. Go to the document library. See that the approver can neither edit nor delete the uploaded documents. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image040_2.gif"&gt;&lt;img title="clip_image040" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="256" alt="clip_image040" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image040_thumb.gif" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Go to the task created for approval. Try to approve it. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image042_2.gif"&gt;&lt;img title="clip_image042" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="clip_image042" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image042_thumb.gif" width="609" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see the “Approver” is able to approve the document. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image044_2.jpg"&gt;&lt;img title="clip_image044" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="clip_image044" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/HowToConfigurepermissionsinOutoftheboxMO_E57B/clip_image044_thumb.jpg" width="610" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Summary:-&lt;/p&gt;  &lt;p&gt;This “How To” shows that it is possible using the out-of-the-box MOSS 2007 approval workflow to create a document approval system where &lt;/p&gt;  &lt;p&gt;1. The “Editors” can only upload documents to be approved but cannot approve the documents themselves. &lt;/p&gt;  &lt;p&gt;2. The “Approvers” can only approve or reject the documents but cannot edit or delete them. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8830213" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/+++Authorization+++/default.aspx">   Authorization   </category></item><item><title>Catch the Security Flaw #3</title><link>http://blogs.msdn.com/varun_sharma/archive/2008/07/14/catch-the-security-flaw-3.aspx</link><pubDate>Mon, 14 Jul 2008 13:17:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8731276</guid><dc:creator>Varun Sharma</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/varun_sharma/comments/8731276.aspx</comments><wfw:commentRss>http://blogs.msdn.com/varun_sharma/commentrss.aspx?PostID=8731276</wfw:commentRss><description>&lt;p&gt;Quite a few web applications encrypt query string values. This is generally done as an added measure to prevent unauthorized access. Since the end user cannot chose a value and then encrypt it, changing parameters becomes difficult. But encryption is not a panacea. See if you can spot this bug. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt1.gif"&gt;&lt;img title="encrypt1" height="524" alt="encrypt1" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt1_thumb.gif" width="750" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The code behind file looks like this:-&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt2_1.gif"&gt;&lt;img title="encrypt2" height="580" alt="encrypt2" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt2_thumb_1.gif" width="750" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Implementation for the Encrypt and Decrypt methods is not shown. They are using the DES algorithm. There is no flaw in the usage or key management. &lt;/p&gt;  &lt;p&gt;The end user can upload files and the screen look like this:-&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt3.gif"&gt;&lt;img title="encrypt3" height="258" alt="encrypt3" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt3_thumb.gif" width="750" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;On clicking Upload, the file gets uploaded and a message is shown. Note the query string values. The HTML source is also shown. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt4.gif"&gt;&lt;img title="encrypt4" height="489" alt="encrypt4" src="http://blogs.msdn.com/blogfiles/varun_sharma/WindowsLiveWriter/CatchtheSecurityFlaw3_9AB4/encrypt4_thumb.gif" width="750" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Do you think the code or design is flawed in any way? Can this be exploited? &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8731276" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/Catch+the+security+flaw/default.aspx">Catch the security flaw</category><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/Cryptography/default.aspx">Cryptography</category><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/+++Authorization+++/default.aspx">   Authorization   </category></item><item><title>Common Authorization flaw in Web Applications: Why disabling buttons (or other controls) is not enough?</title><link>http://blogs.msdn.com/varun_sharma/archive/2008/01/22/web-app-authorization-flaw-why-disabling-buttons-or-other-controls-is-not-enough.aspx</link><pubDate>Tue, 22 Jan 2008 23:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7201540</guid><dc:creator>Varun Sharma</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/varun_sharma/comments/7201540.aspx</comments><wfw:commentRss>http://blogs.msdn.com/varun_sharma/commentrss.aspx?PostID=7201540</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I have seen quite a few web applications that rely on disabling controls for authorization. Consider this code:-&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/7201509/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/7201509/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The scenario may be that the page has to be displayed in a read-only manner for certain roles, or after submission of some details but prior to approval (in a workflow). This reason depends on the business requirement. In this dummy app, the page looks like this:-&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/7201492/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/7201492/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;This authorization can easily be bypassed. Without using any special tool, an attacker can just enter script this way in the address bar and hit enter:-&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/7201500/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/7201500/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Now the attacker enters some text and hits the submit button, completely bypassing the authorization control:-&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/7201503/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/7201503/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Countermeasure:-&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/7201505/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/7201505/original.aspx"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Check the condition in the event handler before taking action. &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7201540" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/+++Authorization+++/default.aspx">   Authorization   </category></item><item><title>Common Authorization Vulnerability in Thick Client applications</title><link>http://blogs.msdn.com/varun_sharma/archive/2007/10/31/common-authorization-vulnerability-in-thick-client-applications.aspx</link><pubDate>Wed, 31 Oct 2007 14:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5797563</guid><dc:creator>Varun Sharma</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/varun_sharma/comments/5797563.aspx</comments><wfw:commentRss>http://blogs.msdn.com/varun_sharma/commentrss.aspx?PostID=5797563</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Consider the following architecture for an intranet application. A thick client installed on the user’s machine connects to a web service which in turn connects to the database. The web service authenticates the caller using windows authentication. It connects to the SQL Server using a fixed identity. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;IMG src="http://blogs.msdn.com/photos/varun_sharma/images/5797536/original.aspx" mce_src="http://blogs.msdn.com/photos/varun_sharma/images/5797536/original.aspx"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;The&amp;nbsp;vulnerability occurs if authorization controls are built into the thick client only and not in the web service. The user can easily bypass these authorization controls by directly accessing the web service. This means that any domain user in intranet can call web methods in the web service which may result in loss of integrity and confidentiality of the data. &lt;/FONT&gt;&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;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Example of vulnerable code in the thick client&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// Thick client code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// Create instance of web proxy class&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Service&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; service = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Service&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;service.Credentials = &lt;SPAN style="COLOR: teal"&gt;CredentialCache&lt;/SPAN&gt;.DefaultCredentials;&lt;SPAN style="COLOR: green"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// Check if user is admin in the application&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (service.IsAdmin())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// If yes, approve the request&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;service.ApproveRequest(100);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// User is not authorized...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;A malicious user can bypass the thick client and call the ApproveRequest web method directly, since it doesn’t authorize. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;A proper design would ensure that authorization takes place in each of the web methods in the web service based on the windows identity of the user. The thick client only represents the user interface and may implement authorization controls only for aesthetic and/ or performance purposes. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;This is an example of how the web service should authorize the caller&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Web service code&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[&lt;SPAN style="COLOR: teal"&gt;WebMethod&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ApproveRequest(&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; RequestId)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// Check if the calling user is in admin role&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (User.IsInRole(&lt;SPAN style="COLOR: maroon"&gt;"Admin"&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// If yes, approve the request&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Request&lt;/SPAN&gt;(RequestId).ApproveRequest();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// User is not authorized...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5797563" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/varun_sharma/archive/tags/+++Authorization+++/default.aspx">   Authorization   </category></item></channel></rss>