<?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>Mike Flasko's Blog : Changes in Whidbey from Everett</title><link>http://blogs.msdn.com/mflasko/archive/tags/Changes+in+Whidbey+from+Everett/default.aspx</link><description>Tags: Changes in Whidbey from Everett</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Strict HTTP Parsing</title><link>http://blogs.msdn.com/mflasko/archive/2005/11/02/488370.aspx</link><pubDate>Wed, 02 Nov 2005 22:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:488370</guid><dc:creator>mflasko</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mflasko/comments/488370.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mflasko/commentrss.aspx?PostID=488370</wfw:commentRss><description>&lt;P&gt;In version 2.0 of the .Net Framework, we (System.Net) changed how we parse HTTP traffic.&amp;nbsp; The change has gone to a more strict parsing model.&amp;nbsp; One example, is we now require a CRLF (carriage return, line feed) at the end of each line.&amp;nbsp;&amp;nbsp;While these changes were done to&amp;nbsp;improve the security of our HTTP stack, it has the negative effect of causing some applications to see exceptions thrown where they didn't previously.&amp;nbsp;&amp;nbsp; If you find the parsing of the HTTP headers to be too strict, you can revert the strictness of our parsing to improve app compatibility.&amp;nbsp; This is done via an application configuration file setting as shown below&lt;/P&gt;
&lt;DIV class=section id=syntaxSection&gt;
&lt;DIV class=code id=syntaxCodeBlocks&gt;&lt;SPAN codeLanguage="other"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;FONT color=#800080&gt;&lt;FONT color=#000000&gt;Hierarchy:&lt;BR&gt;&amp;lt;configuration&amp;gt; Element&lt;BR&gt;&amp;nbsp; &amp;lt;system.Net&amp;gt; Element (Network Settings)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;settings&amp;gt; Element (Network Settings)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;httpWebRequest&amp;gt; Element (Network Settings)&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;lt;httpWebRequest&lt;BR&gt;&amp;nbsp; maximumResponseHeadersLength="size"&lt;BR&gt;&amp;nbsp; maximumErrorResponseLength="size"&lt;BR&gt;&amp;nbsp; maximumUnauthorizedUploadLength="size"&lt;BR&gt;&amp;nbsp; &lt;STRONG&gt;useUnsafeHeaderParsing="true|false"&lt;BR&gt;&lt;/STRONG&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;STRONG&gt;Additional note about UnSafeHeaderParsing:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#800080&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;By default, the .NET Framework strictly enforces RFC 2616 for URI parsing. Some server responses may include control characters in prohibited fields, which will cause the &lt;?XML:NAMESPACE PREFIX = MSHelp NS = "http://msdn.microsoft.com/mshelp" /&gt;&lt;MSHelp:link tabIndex=0 keywords="M:System.Net.HttpWebRequest.GetResponse"&gt;System.Net.HttpWebRequest.GetResponse&lt;/MSHelp:link&gt; method to throw a &lt;MSHelp:link tabIndex=0 keywords="T:System.Net.WebException"&gt;WebException&lt;/MSHelp:link&gt;. If &lt;B&gt;useUnsafeHeaderParsing&lt;/B&gt; is set to &lt;B&gt;true&lt;/B&gt;, &lt;B&gt;System.Net.HttpWebRequest.GetResponse&lt;/B&gt; will not throw in this case; however, your application will be vulnerable to several forms of URI parsing attacks. The best solution is to change the server so that the response does not include control characters.&lt;/FONT&gt;&lt;/P&gt;&lt;SECTIONS xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"&gt;
&lt;P&gt;&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;a href="http://blogs.msdn.com/malarch/archive/2005/09/13/466664.aspx"&gt;&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=488370" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mflasko/archive/tags/Changes+in+Whidbey+from+Everett/default.aspx">Changes in Whidbey from Everett</category></item><item><title>System.Net now registers a default FtpWebRequest implementation </title><link>http://blogs.msdn.com/mflasko/archive/2005/09/11/463868.aspx</link><pubDate>Mon, 12 Sep 2005 08:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463868</guid><dc:creator>mflasko</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mflasko/comments/463868.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mflasko/commentrss.aspx?PostID=463868</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#000000&gt;Prior to the .NET Framework version 2.0, applications could register a component to handle FTP requests using System.Net’s extensible pluggable protocol framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Components for handling different web requests are registered by associating the component with a specific URI prefix.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Any web request that matches that prefix would then be handled by that component.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In version 2.0 of the .NET Framework, System.Net now supports an FtpWebRequest component that is registered by default for the “ftp:” prefix.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Any applications that are registering for this prefix (prior to this release) could now be broken because the prefix (FTP) is already taken.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#000000&gt;There is a workaround for this issue.&amp;nbsp; It is as follows: &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;Update the application configuration file to remove the default FTP pluggable protocol prior to registering your own FTP component:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&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; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;&amp;lt;system.net&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;&amp;lt;webRequestModules&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;&amp;lt;remove prefix = “ftp:” /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#000000&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; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&amp;lt;/webRequestModules&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #339966; FONT-FAMILY: Arial"&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;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#000000&gt;&amp;lt;/system.net&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #339966"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;I hope this information helps to make your applications transition to Whidbey smooth as silk :).&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=463868" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mflasko/archive/tags/Changes+in+Whidbey+from+Everett/default.aspx">Changes in Whidbey from Everett</category></item></channel></rss>