<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kurinchi Blogger Scribbles ... &#187; XSS</title>
	<atom:link href="http://kurinchilamp.kurinchilion.com/tag/xss/feed" rel="self" type="application/rss+xml" />
	<link>http://kurinchilamp.kurinchilion.com</link>
	<description>On Open Source Technologies</description>
	<lastBuildDate>Mon, 02 Jan 2012 06:14:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Cross site scripting Attack &#8211; XSS</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/06/cross-site-scripting-attack-xss.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/06/cross-site-scripting-attack-xss.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 03:41:04 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cookie hijacking]]></category>
		<category><![CDATA[Cross site scripting]]></category>
		<category><![CDATA[malicious attack]]></category>
		<category><![CDATA[non-persistent attack]]></category>
		<category><![CDATA[persistent attack]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=436</guid>
		<description><![CDATA[Cross-Site Scripting (XSS) is the method of code injection whereby a malicious user injects code (html, javascript) which would get executed from the site on the users browser. When Google finds this, it will show up a warning message in its search results if the users had searched for a specific term for which your [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cross-Site Scripting (XSS)</strong> is the method of code injection whereby a malicious user injects code (html, javascript) which would get executed from the site on the users browser. When Google finds this, it will show up a warning message in its search results if the users had searched for a specific term for which your site is indexed. This can harm your user base.</p>
<p><strong>XSS attacks </strong>are classified as<br />
- <strong>Persistent attacks</strong><br />
- <strong>Non-persistent attacks</strong><br />
<span id="more-436"></span><br />
Non-persistent attacks are the holes in the application, where by a malformed code gets injected via your site to your user&#8217;s browser. This mostly happens when search engines indexes a page with a link of your site with malformed code injected by a malicious user.</p>
<p>Persistent attacks occur when the user&#8217;s (malicious) input is entered into a system and get stored into the system without proper validation. When naive users visit your site, they get infected with the malicious users code. This happens in Forums, Comments section where by the entered data is not sanitized.</p>
<p>As the key to accepting any user input, VALIDATE ALL DATA before storing it in your server. That by far reduces a lot of problem and hence saves your time.</p>
<p>To <strong>circumvent XSS</strong>, different users/applications have come with different methods like</p>
<p>i) avoiding html or script input</p>
<p>ii) have custom built tags which behave like html when presenting the text (e.g. wiki)</p>
<p>iii) using regular expression to build filters </p>
<p>Functions used in <strong>MVC frameworks</strong> to prevent XSS attacks<br />
<em>CakePHP: Usage of Sanitize<br />
CodeIgniter: xss_clean</em></p>
<p><a href="http://htmlpurifier.org/" target="_blank">HTMLPurifier</a> is an application used by major softwares like CodeIgniter MVC, Symfony, WordPress, Drupal, Joomla</p>
<p>Read through <a href="http://www.owasp.org/index.php/Category:Vulnerability" target="_blank">OWASP&#8217;s</a> site for a list of common vulnerabilities.</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/06/cross-site-scripting-attack-xss.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP XSS: htmlspecialchars vs. htmlentities</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html#comments</comments>
		<pubDate>Sun, 17 May 2009 16:13:55 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cross site scripting]]></category>
		<category><![CDATA[htmlentities]]></category>
		<category><![CDATA[htmlspecialchars]]></category>
		<category><![CDATA[html_safe library]]></category>
		<category><![CDATA[Pear library]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=333</guid>
		<description><![CDATA[Cross site scripting XSS is a term used to refer attacks or loop holes present in the scripting used by websites favoring hackers to exploit this path towards identity theft or phishing. In PHP, two functions are mainly used to circumvent XSS attacks. i) htmlspecialchars ii) htmlentities i) htmlspecialchars($string, [$quote_option]) takes care of &#038;, &#8220;, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cross site scripting XSS</strong> is a term used to refer attacks or loop holes present in the scripting used by websites favoring hackers to exploit this path towards identity theft or phishing.</p>
<p>In PHP, two functions are mainly used to circumvent XSS attacks.<br />
i) htmlspecialchars<br />
ii) htmlentities<br />
<span id="more-333"></span><br />
i) <strong>htmlspecialchars</strong>($string, [$quote_option]) takes care of &#038;, &#8220;, &#8216;, <, > characters by converting them into equivalent character codes. If quote option is set to ENT_QUOTES it converts &#8216; &#8211; single quotes to &#039; and if it is set to ENT_NOQUOTES it does not convert &#8221; &#8211; double quotes to &quot;</p>
<p>ii) <strong>htmlentities</strong>() is used to escape all html characters from the text and not just the five characters mentioned above. </p>
<p>Note: If you do not want any html characters in the text, use strip_tags($text) instead.</p>
<p>Also check PEAR&#8217;s <a href="http://pear.php.net/package/HTML_Safe" target="_blank">HTML_Safe library</a> </p>
<p>In wikipedia, you can learn more about <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank">XSS </a>and its classification with examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

