<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>&lt;b&gt;@gimmic&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;

&lt;big&gt;&lt;big&gt;W&lt;/big&gt;&lt;/big&gt;ell I've poured over TONS of code this weekend, and needed a bit of time to gather my brain cells.&lt;br /&gt;&lt;br /&gt;

Here's a few things that I've learned about XMLHttpRequest&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href='https://addons.mozilla.org/en-US/firefox/addon/966'&gt;Tamper Data&lt;/a&gt; add-on reports raw data and ignores other extensions &lt;i&gt;(that's a big no no by the way)&lt;/i&gt;.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href='https://addons.mozilla.org/en-US/firefox/addon/3829'&gt;Live HTTP Headers&lt;/a&gt; add-on correctly reports the headers in cooperation with other add-ons.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Firefox 2.X also caches header requests... so they will also only show up once in the logs.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href='https://addons.mozilla.org/firefox/addon/748'&gt;Greasemonkey&lt;/a&gt; is &quot;sorta&quot; responsible for not allowing the Referer header atom value to be set, but then again, sorta not!&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Any call to XMLHttpRequest in the &lt;a href='http://en.wikipedia.org/wiki/Chrome_Mozilla'&gt;chrome namespace&lt;/a&gt;&amp;nbsp;&lt;i&gt;(Firefox add-ons use this for those that don't know this)&lt;/i&gt; is considered &quot;unprivileged&quot; to modify the Referer header atom value &lt;b&gt;UNLESS&lt;/b&gt; there is an event listener that modifies the raw data via the http channel &lt;b&gt;OR&lt;/b&gt; there is a component add-on &lt;i&gt;(I think that's XBL, still a bit noob to some  of this)&lt;/i&gt; that is added to an existing add-on.&lt;br /&gt;&lt;br /&gt;

Firefox currently has two sections, that I can find, in their trunk code &lt;i&gt;(and existing releases too)&lt;/i&gt; that &lt;b&gt;PURPOSELY BLOCKS OR CLEARS&lt;/b&gt; the Referer header atom value from being set in the chrome namespace.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Any XMLHttpRequest call made via &lt;a href='http://wiki.github.com/Martii/greasemonkey/unsafewindow'&gt;unsafeWindow&lt;/a&gt;&amp;nbsp;&lt;i&gt;(e.g. the native DOM object created from a web server)&lt;/i&gt; is considered to be &quot;privileged&quot; enough to set the Referer header atom value.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;

These last two points seem backwards... MOST security threats, in my circles, come from commercial entities NOT from scripters... but I know that's not always the case.&lt;br /&gt;&lt;br /&gt;

Currently Firefox is not following the &lt;a href=http://www.w3.org/TR/2007/WD-XMLHttpRequest-20071026/#xmlhttprequest'&gt;W3C recommendations on XMLHttpRequest&lt;/a&gt; by not allowing the Referer header atom value to be set in the chrome namespace using setRequestHeader.&lt;br /&gt;&lt;br /&gt;
W3C Working Draft &lt;i&gt;(e.g. a whitepaper or RFC)&lt;/i&gt; 26 October 2007 clip from Section 2, setRequestHeader method, Item 6 &lt;ul&gt;&lt;li&gt;&lt;i&gt;&lt;b&gt;&lt;big&gt;&lt;big&gt;&lt;sup&gt;&amp;laquo;&lt;/sup&gt;&lt;/big&gt;&lt;/big&gt;&lt;/b&gt;6. For security reasons, these steps should be terminated if the header argument &lt;b&gt;case-insensitively matches&lt;/b&gt; one of the following headers:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;  Accept-Charset
    &lt;li&gt; Accept-Encoding
    &lt;li&gt; Connection
    &lt;li&gt; Content-Length
    &lt;li&gt; Content-Transfer-Encoding
    &lt;li&gt; Date
    &lt;li&gt; Expect
    &lt;li&gt; Host
    &lt;li&gt; Keep-Alive
    &lt;li&gt; &lt;b&gt;Referer&lt;/b&gt;
    &lt;li&gt; TE
    &lt;li&gt; Trailer
    &lt;li&gt; Transfer-Encoding
    &lt;li&gt; Upgrade
    &lt;li&gt; Via 
&lt;/ul&gt;

&lt;b&gt;&lt;big&gt;&lt;big&gt;&lt;sup&gt;&amp;raquo;&lt;/sup&gt;&lt;/big&gt;&lt;/big&gt;&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

I may annotate/cite this post further later... but I've been busy putting what I've learned in the last 36 hours into motion and I'm a bit dain bread from all of this.&lt;br /&gt;&lt;br /&gt;
8D&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Other related links&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;small&gt;
&lt;a href='http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669'&gt;http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669&lt;/a&gt;&lt;br /&gt;
&lt;a href='http://wiki.github.com/Martii/greasemonkey/gm_xmlhttprequest'&gt;GM_xmlhttpRequest&lt;/a&gt;
&lt;/small&gt;&lt;/small&gt;</body>
  <body-html>&lt;b&gt;@gimmic&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;big&gt;W&lt;/big&gt;&lt;/big&gt;ell I've poured over TONS of code this weekend, and needed a bit of time to gather my brain cells.&lt;br /&gt;&lt;br /&gt;

Here's a few things that I've learned about XMLHttpRequest&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/966&quot;&gt;Tamper Data&lt;/a&gt; add-on reports raw data and ignores other extensions &lt;i&gt;(that's a big no no by the way)&lt;/i&gt;.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3829&quot;&gt;Live HTTP Headers&lt;/a&gt; add-on correctly reports the headers in cooperation with other add-ons.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Firefox 2.X also caches header requests... so they will also only show up once in the logs.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/firefox/addon/748&quot;&gt;Greasemonkey&lt;/a&gt; is &quot;sorta&quot; responsible for not allowing the Referer header atom value to be set, but then again, sorta not!&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Any call to XMLHttpRequest in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Chrome_Mozilla&quot;&gt;chrome namespace&lt;/a&gt;&amp;nbsp;&lt;i&gt;(Firefox add-ons use this for those that don't know this)&lt;/i&gt; is considered &quot;unprivileged&quot; to modify the Referer header atom value &lt;b&gt;UNLESS&lt;/b&gt; there is an event listener that modifies the raw data via the http channel &lt;b&gt;OR&lt;/b&gt; there is a component add-on &lt;i&gt;(I think that's XBL, still a bit noob to some  of this)&lt;/i&gt; that is added to an existing add-on.&lt;br /&gt;&lt;br /&gt;

Firefox currently has two sections, that I can find, in their trunk code &lt;i&gt;(and existing releases too)&lt;/i&gt; that &lt;b&gt;PURPOSELY BLOCKS OR CLEARS&lt;/b&gt; the Referer header atom value from being set in the chrome namespace.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Any XMLHttpRequest call made via &lt;a href=&quot;http://wiki.github.com/Martii/greasemonkey/unsafewindow&quot;&gt;unsafeWindow&lt;/a&gt;&amp;nbsp;&lt;i&gt;(e.g. the native DOM object created from a web server)&lt;/i&gt; is considered to be &quot;privileged&quot; enough to set the Referer header atom value.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;

These last two points seem backwards... MOST security threats, in my circles, come from commercial entities NOT from scripters... but I know that's not always the case.&lt;br /&gt;&lt;br /&gt;

Currently Firefox is not following the &lt;a href=&quot;http://www.w3.org/TR/2007/WD-XMLHttpRequest-20071026/#xmlhttprequest&quot;&gt;W3C recommendations on XMLHttpRequest&lt;/a&gt; by not allowing the Referer header atom value to be set in the chrome namespace using setRequestHeader.&lt;br /&gt;&lt;br /&gt;
W3C Working Draft &lt;i&gt;(e.g. a whitepaper or RFC)&lt;/i&gt; 26 October 2007 clip from Section 2, setRequestHeader method, Item 6 &lt;ul&gt;&lt;li&gt;&lt;i&gt;&lt;b&gt;&lt;big&gt;&lt;big&gt;&lt;sup&gt;&amp;laquo;&lt;/sup&gt;&lt;/big&gt;&lt;/big&gt;&lt;/b&gt;6. For security reasons, these steps should be terminated if the header argument &lt;b&gt;case-insensitively matches&lt;/b&gt; one of the following headers:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;  Accept-Charset
    &lt;/li&gt;&lt;li&gt; Accept-Encoding
    &lt;/li&gt;&lt;li&gt; Connection
    &lt;/li&gt;&lt;li&gt; Content-Length
    &lt;/li&gt;&lt;li&gt; Content-Transfer-Encoding
    &lt;/li&gt;&lt;li&gt; Date
    &lt;/li&gt;&lt;li&gt; Expect
    &lt;/li&gt;&lt;li&gt; Host
    &lt;/li&gt;&lt;li&gt; Keep-Alive
    &lt;/li&gt;&lt;li&gt;&lt;b&gt;Referer&lt;/b&gt;&lt;/li&gt;&lt;li&gt; TE
    &lt;/li&gt;&lt;li&gt; Trailer
    &lt;/li&gt;&lt;li&gt; Transfer-Encoding
    &lt;/li&gt;&lt;li&gt; Upgrade
    &lt;/li&gt;&lt;li&gt; Via 
&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;big&gt;&lt;big&gt;&lt;sup&gt;&amp;raquo;&lt;/sup&gt;&lt;/big&gt;&lt;/big&gt;&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

I may annotate/cite this post further later... but I've been busy putting what I've learned in the last 36 hours into motion and I'm a bit dain bread from all of this.&lt;br /&gt;&lt;br /&gt;
8D&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Other related links&lt;br /&gt;&lt;small&gt;&lt;small&gt;&lt;a href=&quot;http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669&quot;&gt;http://groups.google.com/group/greasemonkey-dev/browse_thread/thread/77c94cc17c6b2669&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://wiki.github.com/Martii/greasemonkey/gm_xmlhttprequest&quot;&gt;GM_xmlhttpRequest&lt;/a&gt;&lt;/small&gt;&lt;/small&gt;&lt;/b&gt;</body-html>
  <created-at type="datetime">2007-12-04T11:04:29Z</created-at>
  <forumable-id type="integer">1</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">5312</id>
  <topic-id type="integer">1302</topic-id>
  <updated-at type="datetime">2009-10-13T07:06:16Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">37004</user-id>
</post>
