<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks &#187; safety</title>
	<atom:link href="http://www.sajithmr.me/tag/safety/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Sat, 07 Apr 2012 16:30:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Quick tips for https connection (Non secure content warning &#8211; IE)</title>
		<link>http://www.sajithmr.me/quick-tips-for-https-connection-non-secure-content-warning-ie</link>
		<comments>http://www.sajithmr.me/quick-tips-for-https-connection-non-secure-content-warning-ie#comments</comments>
		<pubDate>Mon, 17 May 2010 23:14:49 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[https warning]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[non-secure content]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[safety]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=713</guid>
		<description><![CDATA[If you are using https pages or some of the pages (payment pages etc) in your website, keep the following in your mind. In some browsers especially IE shows warning of non-secured content in secured page. This cause user the feeling that the website is not secured. Use relative url always. Relative URL means those [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-714" title="browsers_dhtml" src="http://www.sajithmr.me/wp-content/uploads/2010/05/browsers_dhtml.jpg" alt="browsers_dhtml" width="270" height="250" /></p>
<p>If you are using https pages or some of the pages (payment pages etc) in your website, keep the following in your mind. In some browsers especially IE shows warning of non-secured content in secured page. This cause user the feeling that the website is not secured.</p>
<ol>
<li>Use relative url always. Relative URL means those without starting with http:// or https://, instead use relative url.</li>
<li>If you need to use full url, use dynamic base name in with your programming language.For example in PHP, define BASE_URL = http://www.yoursite.com and use this variable in every links and forms. Change the BASE_URL value between http and https depending upon the protocol ($_SERVER['HTTP_HOST'])</li>
<li>Check  inside javascript function whether it is calling any non-secured url. (For example, sometime you may use full url inside Javascript). Check using if condition to decide, which protocol to use, like what Google Analytic does.<br />
eg:  (&#8220;https:&#8221; == document.location.protocol) ? &#8220;https://ssl.&#8221; : &#8220;http://www.&#8221;);</li>
<li> Check if there is any flash content which tries to load data from non-secured url. There is a chance to load some xml configuration files using http protocol</li>
<li> Also change the codebase parameter value in object tag (flash or other media) whether it is pointing http or https url. There is a chance for this url in flash content.<br />
<span style="color: #ff6600;">codebase=&#8221;http://download.macromedia.com/pub/shockwave /cabs/flash/swflash.cab#version=9,0,115,0&#8243;<br />
<span style="color: #000000;">Change this url to https://downoad&#8230;<br />
</span><br />
</span></li>
<li><span style="color: #ff6600;"><span style="color: #000000;">If you are using facebook connect or such integration, check the javascript initialisation code.<br />
<span style="color: #008000;">FB.init(&#8220;78bc8ffb87c41eabb6395a2045c76021&#8243;, &#8220;/xd_receiver.htm</span>&#8220;);<br />
Inside the xd_receiver.htm file, the cross platform callback will be non secured url (http)<br />
Change this to xd_reciver_ssl.htm and use new code, which is available in Facebook documentation</p>
<p></span></span></li>
</ol>
<p>Tools like Fiddler can be used to check which url is non-secured. Firebug cannot show all non-secure connections. If the above steps do not solve your problem, try disabling javascript files one by one to point out which call is making the problem. Also try this by disabling Flash objects one by one.</p>
<p>Good luck guys</p>
<p>Cheers</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/quick-tips-for-https-connection-non-secure-content-warning-ie/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Session/Cookie alone does not secure your web application &#8211; CSRF</title>
		<link>http://www.sajithmr.me/csrf</link>
		<comments>http://www.sajithmr.me/csrf#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:01:17 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[csrf]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[safety]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=500</guid>
		<description><![CDATA[Guess what will happen if you add an image like below in your html page: &#60;img src=&#8221;http://mail.google.com/mail/?logout&#38;hl=en&#8221;  /&#62; It does not appear in page, but your google account in another window or another tab will get logoff. Now an external website could logout you from your gmail or orkut. IF you coded your website to [...]]]></description>
			<content:encoded><![CDATA[<p>Guess what will happen if you add an image like below in your html page:</p>
<p>&lt;img src=&#8221;http://mail.google.com/mail/?logout&amp;hl=en&#8221;  /&gt;</p>
<p>It does not appear in page, but your google account in another window or another tab will get logoff. Now an external website could logout you from your gmail or orkut.</p>
<p><img class="alignnone size-full wp-image-503" src="http://www.sajithmr.me/wp-content/uploads/2009/11/Gmail-Login-Gets-CSRF-Protection-2.jpg" alt="" width="290" height="245" /></p>
<p>IF you coded your website to delete a photo or object from the website, like this: www.domainname.com/photos/delete?id=221, you may think , since you are checking user authentication at server side, no one else can delete your file. But what if you are logged in one tab and in the second tab, you are loading another website (of hacker or attacker), he can place lots of hidden images with src = www.domainname.com/photos/delete?id=22 ( he can try with ids from 0 to 1000 or 10,000, and anyone of them may be your object)</p>
<p>Here the authentication is okay , because the cookies and session is already set in another tab, and it affects (update or delete) your content.</p>
<p>Those who think , I use POST method , so it is safe. Sorry, you are wrong. A javascript can also simulate a post method, and by using this, an external website can update your form (For example they can run a form submission for changing the email which you registered with and later they can reset password to hack your account)</p>
<p>It won&#8217;t happens if you use captcha. But for all forms it is very hard to use CAPTCHA everywhere. You can solve this attack using additional parameter (some string combination which is generated randomly) along with GET url or POST form submission.</p>
<p>For example, check the url to delete a mail in gmail.</p>
<p><span style="color: #0000ff;">http://mail.google.com/mail/?ui=2&amp;ik=42e598c952&amp;at=xn3j2ufyx273muje67ot1fsxsnbmnl&amp;<br />
view=up&amp;act=tr&amp;rt=j&amp;search=inbox</span></p>
<p>There is some extra string alone with useful information as parameter. So an external application cannot predict the exact url to delete a particular mail, so img with src= url fails here.</p>
<p>Same thing is also needed in POST method. Add one hidden field for random string and check the string before updating into database from Server.</p>
<p>This problem is called <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery" target="_blank">CSRF</a> &#8211; Cross Site Request Forgery</p>
<p>Thanks<br />
Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/csrf/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

