<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: JS injection</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/js-injection/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>humbol on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27954</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27954</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Now i understood why it is not by default, however :</p>
<p>&#39;Now when&#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit471' value='Select Code' data-codeid='sfcode471' /></p>
<div class='sfcode' id='sfcode471'>autoencode</div>
<p>&#160;is set to true we encode the data coming from server and not only when we post it (secutity fix)&#39;</p>
<p>you ve data sanitized twice, so you ve to un sanitize data when you receive it.</p>
]]></description>
        	        	<pubDate>Fri, 21 Dec 2012 12:56:58 +0200</pubDate>
        </item>
        <item>
        	<title>tony on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27952</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27952</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Look <a href="http://blogs.teamb.com/craigstuntz/2010/02/08/38548/" target="_blank">here</a></p>
]]></description>
        	        	<pubDate>Fri, 21 Dec 2012 12:39:47 +0200</pubDate>
        </item>
        <item>
        	<title>humbol on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27951</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27951</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I just checked but still for the standard behaviour is doesnt seems logical to me.</p>
<p>If you set autoencode to true, then when you post to the server &#160;&#39;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9859' value='Select Code' data-codeid='sfcode9859' /></p>
<div class='sfcode' id='sfcode9859'>&#60;&#39;</div>
<p>&#160;will be converted to &#39;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3929' value='Select Code' data-codeid='sfcode3929' /></p>
<div class='sfcode' id='sfcode3929'>&#38;lt;&#39; , this means that i ll save &#39;&#38;lt;&#39; in my db. Afterwards, when i rebuild the grid with the data store, my json data will be</div>
<p>{test:&#39;&#38;lt;&#39;} so in the cell grid will appear &#39;&#38;lt;&#39;, if you edit and save, the post will be {test:&#39;&#38;amp;lt;&#39;} and so on.</p>
<p>So, it just doesnt seem logical that I ve to un-encode the data in the server side. I ll just want to receive in the server what the user type (then i do what i want with that data), but the grid ve to be consistent.</p>
</p>
<p>For the moment what i do, is all the data that came from the server is already html escaped. and whenever i do &#160;editGridRow i set it to reloadAfterSubmit:true . This is a workaround that works, but I guess that is not what most people expects from this component.</p>
<p>thanks</p></p>
]]></description>
        	        	<pubDate>Fri, 21 Dec 2012 11:18:35 +0200</pubDate>
        </item>
        <item>
        	<title>tony on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27947</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27947</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Look at autoencode option in grid settings.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Fri, 21 Dec 2012 10:25:21 +0200</pubDate>
        </item>
        <item>
        	<title>humbol on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27944</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27944</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>Thanks for the response, in fact i dont remember reading it, if you can pointing that info out i would appreciate.</p>
<p>However, back to the issue, if you write some invalid js line inside the script (i.e &#60;script&#62;xx&#60;/script&#62;), then the row is not consistent anymore. Try to edit it afterwards and see.&#160;</p>
<p>My point is as follow, this injection or error is in the client side (i can escape things from my server, no prob), but this is the standard behaviour and as you can see even the demos are expossed. &#160;</p>
</p>
<p>regards,</p>
</p>
<p>Humbol</p>
]]></description>
        	        	<pubDate>Fri, 21 Dec 2012 00:11:00 +0200</pubDate>
        </item>
        <item>
        	<title>tony on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27941</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27941</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>It seems to me you do not have read the docs in order to see how you can avoid this.</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 20 Dec 2012 19:28:31 +0200</pubDate>
        </item>
        <item>
        	<title>humbol on JS injection</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27940</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/js-injection#p27940</guid>
        	        	<description><![CDATA[<p>Hello,&#160;</p>
<p>I have the following problem, whenever the user edit a row with the editGridRow or similar, there are no check of what the info is inserted.</p>
<p>You can check this behaviour in the Jqgrid demos. Row editing -&#62; Basic Example</p>
<p>edit the row and modify the Client column with the following string :</p>
<p>&#60;script&#62;alert(1)&#60;/script&#62;</p>
<p>then, when you save it the alert popups. And then if you edit it again the field is empty.</p>
<p>I guess that if we really trust the user and we want that he/she enters html data, then you can define in the editrules&#160;something like html:true, but in most cases that we dont trust you should escape js html tags just for showing it into the grid.</p>
<p>thanks in advance.</p></p>
]]></description>
        	        	<pubDate>Thu, 20 Dec 2012 19:13:55 +0200</pubDate>
        </item>
</channel>
</rss>