<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   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/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Ken Snyder - XHTML</title>
    <link>http://kendsnyder.com/</link>
    <description>PHP, JavaScript, CSS</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Wed, 11 Jun 2008 04:24:42 GMT</pubDate>

    <image>
        <url>http://kendsnyder.com/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Ken Snyder - XHTML - PHP, JavaScript, CSS</title>
        <link>http://kendsnyder.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Cross Site Scripting</title>
    <link>http://kendsnyder.com/archives/10-Cross-Site-Scripting.html</link>
            <category>Web Development</category>
            <category>XHTML</category>
    
    <comments>http://kendsnyder.com/archives/10-Cross-Site-Scripting.html#comments</comments>
    <wfw:comment>http://kendsnyder.com/wfwcomment.php?cid=10</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://kendsnyder.com/rss.php?version=2.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    

    <author>nospam@example.com (Ken Snyder)</author>
    <content:encoded>
    
&lt;p&gt;Today I looked into defenses against Cross Site Scripting. I ran into &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/ha.ckers.org/xss.html&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://ha.ckers.org/xss.html&quot;&gt;ha.ckers.org&lt;/a&gt; which apparently &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/owasp.org&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://owasp.org&quot;&gt;OWASP&lt;/a&gt; references. I hear that ha.ckers.org page is quite well known.&lt;/p&gt;

&lt;p&gt;Based on that research, I glean several things. Below are the highlights.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Avoid allowing &amp;lt; or &amp;gt; symbols if at all possible.&lt;/li&gt;
	&lt;li&gt;When you must accept HTML content, scrub input with &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/htmlpurifier.org&#039;);&quot;  target=&quot;_blank&quot; href=&quot;http://htmlpurifier.org&quot;&gt;HTMLPurifier&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Avoid putting user-input content into HTML attributes. All types of attacks are possible using ampersands and such.&lt;/li&gt;
	&lt;li&gt;Scrub all output and escape HTML entities.&lt;/li&gt;
&lt;li&gt;Using a black-list filter is a really bad idea.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I may report more in depth in the future.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 10 Jun 2008 22:13:42 -0600</pubDate>
    <guid isPermaLink="false">http://kendsnyder.com/archives/10-guid.html</guid>
    
</item>

</channel>
</rss>