<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Building Browsergames - Latest Comments in Cross Site Scripting: what it is, and how to prevent it</title><link>http://bbgames.disqus.com/</link><description></description><language>en</language><lastBuildDate>Mon, 29 Dec 2008 13:56:31 -0000</lastBuildDate><item><title>Re: Cross Site Scripting: what it is, and how to prevent it</title><link>http://buildingbrowsergames.com/2008/04/28/cross-site-scripting-what-it-is-and-how-to-prevent-it/#comment-4729970</link><description>Roy,&lt;br&gt;You could definitely do both - how much you allow or disallow is entirely up&lt;br&gt;to you.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bbgames</dc:creator><pubDate>Mon, 29 Dec 2008 13:56:31 -0000</pubDate></item><item><title>Re: Cross Site Scripting: what it is, and how to prevent it</title><link>http://buildingbrowsergames.com/2008/04/28/cross-site-scripting-what-it-is-and-how-to-prevent-it/#comment-4676469</link><description>So why not simply do both? Make Account names viable if they are only Numbers and letters( ex A-Z, a-z, 0-9), no other char allowed, as well as escaping the repeating  information?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Roy</dc:creator><pubDate>Sun, 28 Dec 2008 10:46:45 -0000</pubDate></item><item><title>Re: Cross Site Scripting: what it is, and how to prevent it</title><link>http://buildingbrowsergames.com/2008/04/28/cross-site-scripting-what-it-is-and-how-to-prevent-it/#comment-3579877</link><description>While it would make sense to escape the username before it enters the&lt;br&gt;database, escaping it afterwards helps protect you against XSS attacks that&lt;br&gt;originate *from* your database - for example, if an attacker gained access&lt;br&gt;to your database and hand-entered the data.&lt;br&gt;Rejecting usernames that have special characters in them isn't a bad idea,&lt;br&gt;but it tends to confuse the user - which characters are invalid? Which&lt;br&gt;aren't? It would be more useful if you could tell them which characters were&lt;br&gt;not allowed.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bbgames</dc:creator><pubDate>Thu, 06 Nov 2008 20:36:43 -0000</pubDate></item><item><title>Re: Cross Site Scripting: what it is, and how to prevent it</title><link>http://buildingbrowsergames.com/2008/04/28/cross-site-scripting-what-it-is-and-how-to-prevent-it/#comment-3565032</link><description>I agree that as a general rule this is excellent practice but for something like the user name wouldn't it make for sense to escape it before adding it to the database instead of every time it is displayed? In fact as part of my registration validation I compare the user name with the return from the escape function and if they're not equal I reject the name:&lt;br&gt;&lt;br&gt;if ($username != htmlspecialchars($username)) {&lt;br&gt;   $err = "name contains invalid characters";&lt;br&gt;}</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Abraxas</dc:creator><pubDate>Thu, 06 Nov 2008 00:39:04 -0000</pubDate></item></channel></rss>