glaring holes already out-there due to this bug....
I don't think many really see the issue here. I noticed the lack of escaping purely by accident. Having assumed that it would be the default behavior.....
Our data is email connection records using exim's mysql feature. - we store things like subject / from: line and use this to enable and administrator determine if the end user should receive the email (like spam or recruitment emails from competitors.)
I've installed this on my own server to test, and noticed that
xxx <email@address> was just rendering as xxx - with the email hidden...
We work with raw data in all places, the only place where it's not 'raw' is where it is displayed, in which case it should be escaped. - I would surprised if
http://www.yui-ext.com/forum2/topics-remote.php escapes data.. - opening up all cookies in this forum for usage by a malicious attacker...
If this is anything to go by, - there are alot of open door's out there...
http://75.126.167.146/forum/showthread.php?p=37106
While not in this particular application, I often do some data processing of data in the grid, client side. and It is essential that the data is not munged in any way so the processing can provide the correct results.
I have seen many applications that are complete messes, as they tried to munge the data at various points and resulted in gibberish at the end of the day. - There is nothing wrong in storing raw data from post's in database - mysql_escape/stored procedures solve that issue.
There is nothing wrong in sending raw data via json (most json libraries correctly escape that data). But then displaying that data 'as is' on something like grid is just dangerous.
The fix may have a small performance hit (read extremely small in most cases, compared to the HTTP call required to fetch the data). and can easily be turned off.. hence I would be surprised not to see it used..
htmlencode? - really handle all escaping?
I'm not sure if htmlEncode is a vaild way of doing html encoding - have a look at PHP's htmlentites functions to get an idea of the real complexity.. - using DOM textNode's is probably going to catch far more edge cases : - UTF8 international characters etc....
But again, not having this as default behaviour is not only a little unexpected, but very risky.