<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Handling URL protocol handlers</title>
	<atom:link href="http://larholm.com/2007/07/25/handling-url-protocol-handlers/feed/" rel="self" type="application/rss+xml" />
	<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/</link>
	<description>Me, myself and I</description>
	<pubDate>Thu, 11 Mar 2010 03:37:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Thor Larholm</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1106</link>
		<dc:creator>Thor Larholm</dc:creator>
		<pubDate>Thu, 26 Jul 2007 01:11:54 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1106</guid>
		<description>Aaron, I linked to them in my previous comment, but approved your comment as well to better point them out :)

Regards
Thor Larholm</description>
		<content:encoded><![CDATA[<p>Aaron, I linked to them in my previous comment, but approved your comment as well to better point them out <img src='http://larholm.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards<br />
Thor Larholm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Margosis</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1105</link>
		<dc:creator>Aaron Margosis</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1105</guid>
		<description>In your reply to Alun's comment, it sounds as though you're arguing for breaking compatibility with existing ("outdated") protocol handlers by changing what urlmon.dll passes to them, even though all of them not written by Mozilla may be correct the way they are.  This won't help security -- if handlers are not validating their input, the URI provider will have innumerable ways to exploit them, whether urlmon.dll encodes spaces or not.</description>
		<content:encoded><![CDATA[<p>In your reply to Alun&#8217;s comment, it sounds as though you&#8217;re arguing for breaking compatibility with existing (&#8221;outdated&#8221;) protocol handlers by changing what urlmon.dll passes to them, even though all of them not written by Mozilla may be correct the way they are.  This won&#8217;t help security &#8212; if handlers are not validating their input, the URI provider will have innumerable ways to exploit them, whether urlmon.dll encodes spaces or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Margosis</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1099</link>
		<dc:creator>Aaron Margosis</dc:creator>
		<pubDate>Wed, 25 Jul 2007 22:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1099</guid>
		<description>You should link to Alun Jones' insightful posts as well:
http://msmvps.com/blogs/alunj/archive/2007/07/22/firefoxurl-url-vulnerability.aspx
http://msmvps.com/blogs/alunj/archive/2007/07/23/firefoxurl-part-ii.aspx</description>
		<content:encoded><![CDATA[<p>You should link to Alun Jones&#8217; insightful posts as well:<br />
<a href="http://msmvps.com/blogs/alunj/archive/2007/07/22/firefoxurl-url-vulnerability.aspx" rel="nofollow">http://msmvps.com/blogs/alunj/archive/2007/07/22/firefoxurl-url-vulnerability.aspx</a><br />
<a href="http://msmvps.com/blogs/alunj/archive/2007/07/23/firefoxurl-part-ii.aspx" rel="nofollow">http://msmvps.com/blogs/alunj/archive/2007/07/23/firefoxurl-part-ii.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thor Larholm</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1097</link>
		<dc:creator>Thor Larholm</dc:creator>
		<pubDate>Wed, 25 Jul 2007 22:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1097</guid>
		<description>Alun, I don't attribute the parsing to some theorized process, but I do believe that IE should implement some form of minimally invasive data encoding before handing off the string to the protocol handler. (For the other readers here, go read Aluns &lt;a href="http://msmvps.com/blogs/alunj/archive/2007/07/22/firefoxurl-url-vulnerability.aspx" rel="nofollow"&gt;nice &lt;/a&gt; &lt;a href="http://msmvps.com/blogs/alunj/archive/2007/07/23/firefoxurl-part-ii.aspx" rel="nofollow"&gt;posts&lt;/a&gt;.)

I'm not suggesting that you take the route of Safari and indiscriminately URL encode the entire input string, which brings down the data delivery from 100% to some 25% (take a look at it, it's horrible). 

I just really think that we will have to settle for some minor inconvenience by accommodating a few outdated protocol handlers through some minor data encoding changes. Even outlook gets this wrong.

Standards and recommendations change over time and it's time for us to be more specific about what we sent to all of those random protocol handlers that are present on a system. We have long since disabled SMTP relaying even though it was part of the standard and we just have to face the fact that most protocol handlers are not parsing their input correctly, but instead parsing the input as if it were a console command line.

Regards
Thor Larholm</description>
		<content:encoded><![CDATA[<p>Alun, I don&#8217;t attribute the parsing to some theorized process, but I do believe that IE should implement some form of minimally invasive data encoding before handing off the string to the protocol handler. (For the other readers here, go read Aluns <a href="http://msmvps.com/blogs/alunj/archive/2007/07/22/firefoxurl-url-vulnerability.aspx" rel="nofollow">nice </a> <a href="http://msmvps.com/blogs/alunj/archive/2007/07/23/firefoxurl-part-ii.aspx" rel="nofollow">posts</a>.)</p>
<p>I&#8217;m not suggesting that you take the route of Safari and indiscriminately URL encode the entire input string, which brings down the data delivery from 100% to some 25% (take a look at it, it&#8217;s horrible). </p>
<p>I just really think that we will have to settle for some minor inconvenience by accommodating a few outdated protocol handlers through some minor data encoding changes. Even outlook gets this wrong.</p>
<p>Standards and recommendations change over time and it&#8217;s time for us to be more specific about what we sent to all of those random protocol handlers that are present on a system. We have long since disabled SMTP relaying even though it was part of the standard and we just have to face the fact that most protocol handlers are not parsing their input correctly, but instead parsing the input as if it were a console command line.</p>
<p>Regards<br />
Thor Larholm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alun Jones</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1096</link>
		<dc:creator>Alun Jones</dc:creator>
		<pubDate>Wed, 25 Jul 2007 22:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1096</guid>
		<description>"Ideally the protocol handler should receive the input 100% unaltered," you say, and on this I agree with that same 100%. However, you are clinging to the notion that "Quotes have a special meaning on the command line and can be used to separate arguments". This is incorrect. Quotes have a special meaning to batch files, and to C/C++ console-mode programs, and possibly a number of others. That is a side-effect of the language chosen, not of the 'command line'. Go look at stdargv.c in the C RTL - it parses a monolithic command line into an array of strings to hand it to the C main() function. If you're writing a Win32 application, its WinMain() function receives a single, monolithic command line - unprocessed, uninterpreted, for the program to parse as it sees fit - even to completely ignore common argument separation syntax.
It is therefore the choice of the protocol handler's author whether to submit to the run-time library's command line parser, or to treat the command line as a single string.
Look at the definition of WinMain. http://msdn2.microsoft.com/en-us/library/ms633559.aspx - a single LPSTR, null-terminated (yeah, play with that)
If you're writing a C/C++ program and want different command line parsing semantics, write your own _setargv routine, as described in http://msdn2.microsoft.com/en-us/library/ms857738.aspx
If you read my blog, you wouldn't have attributed the parsing of arguments to some process that you theorise to exist between Internet Explorer's call of ShellExecute and the loading of the executable's code. :)</description>
		<content:encoded><![CDATA[<p>&#8220;Ideally the protocol handler should receive the input 100% unaltered,&#8221; you say, and on this I agree with that same 100%. However, you are clinging to the notion that &#8220;Quotes have a special meaning on the command line and can be used to separate arguments&#8221;. This is incorrect. Quotes have a special meaning to batch files, and to C/C++ console-mode programs, and possibly a number of others. That is a side-effect of the language chosen, not of the &#8216;command line&#8217;. Go look at stdargv.c in the C RTL - it parses a monolithic command line into an array of strings to hand it to the C main() function. If you&#8217;re writing a Win32 application, its WinMain() function receives a single, monolithic command line - unprocessed, uninterpreted, for the program to parse as it sees fit - even to completely ignore common argument separation syntax.<br />
It is therefore the choice of the protocol handler&#8217;s author whether to submit to the run-time library&#8217;s command line parser, or to treat the command line as a single string.<br />
Look at the definition of WinMain. <a href="http://msdn2.microsoft.com/en-us/library/ms633559.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms633559.aspx</a> - a single LPSTR, null-terminated (yeah, play with that)<br />
If you&#8217;re writing a C/C++ program and want different command line parsing semantics, write your own _setargv routine, as described in <a href="http://msdn2.microsoft.com/en-us/library/ms857738.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms857738.aspx</a><br />
If you read my blog, you wouldn&#8217;t have attributed the parsing of arguments to some process that you theorise to exist between Internet Explorer&#8217;s call of ShellExecute and the loading of the executable&#8217;s code. <img src='http://larholm.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thor Larholm</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1093</link>
		<dc:creator>Thor Larholm</dc:creator>
		<pubDate>Wed, 25 Jul 2007 19:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1093</guid>
		<description>Ideally the protocol handler should receive the input 100% unaltered. The problem is that IE and Firefox do not encode that input properly for the transport channel, which in this case is the command line, and therefor the input data alters the operation of the transport channel.

This is no different than HTTP Response Splitting where a literal line break would alter the operation of the transport channel (HTTP) and where the receiving party would get 100% unaltered input if the line break was properly escaped for the transport channel (%0A%0D).

Quotes have a special meaning on the command line and can be used to separate arguments, which is why you have escape characters such as \ or ^.

something.exe "test^" -arg ^"value"

would hand off a single argument to something.exe, and that argument would be the literal string 

test" -arg "value

Regards
Thor Larholm</description>
		<content:encoded><![CDATA[<p>Ideally the protocol handler should receive the input 100% unaltered. The problem is that IE and Firefox do not encode that input properly for the transport channel, which in this case is the command line, and therefor the input data alters the operation of the transport channel.</p>
<p>This is no different than HTTP Response Splitting where a literal line break would alter the operation of the transport channel (HTTP) and where the receiving party would get 100% unaltered input if the line break was properly escaped for the transport channel (%0A%0D).</p>
<p>Quotes have a special meaning on the command line and can be used to separate arguments, which is why you have escape characters such as \ or ^.</p>
<p>something.exe &#8220;test^&#8221; -arg ^&#8221;value&#8221;</p>
<p>would hand off a single argument to something.exe, and that argument would be the literal string </p>
<p>test&#8221; -arg &#8220;value</p>
<p>Regards<br />
Thor Larholm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aviv Raff</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1091</link>
		<dc:creator>Aviv Raff</dc:creator>
		<pubDate>Wed, 25 Jul 2007 19:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1091</guid>
		<description>Skype also registers itself under the "skype:" protocol handler. 
One of the things you can do with this is to shutdown user's Skype from remote. 
I've published a proof of concept on my blog: http://aviv.raffon.net/2007/07/10/CrossApplicationScriptingWhoseFaultIsIt.aspx</description>
		<content:encoded><![CDATA[<p>Skype also registers itself under the &#8220;skype:&#8221; protocol handler.<br />
One of the things you can do with this is to shutdown user&#8217;s Skype from remote.<br />
I&#8217;ve published a proof of concept on my blog: <a href="http://aviv.raffon.net/2007/07/10/CrossApplicationScriptingWhoseFaultIsIt.aspx" rel="nofollow">http://aviv.raffon.net/2007/07/10/CrossApplicationScriptingWhoseFaultIsIt.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larholm.com - Me, myself and I &#187; Mozilla Protocol Abuse</title>
		<link>http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1088</link>
		<dc:creator>Larholm.com - Me, myself and I &#187; Mozilla Protocol Abuse</dc:creator>
		<pubDate>Wed, 25 Jul 2007 18:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/2007/07/25/handling-url-protocol-handlers/#comment-1088</guid>
		<description>[...] Handling URL protocol handlers  [...]</description>
		<content:encoded><![CDATA[<p>[...] Handling URL protocol handlers  [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
