MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/xydg3/a_javascript_security_flaw/c5r1z5i/?context=3
r/javascript • u/davemo Front-End Engineer • Aug 09 '12
13 comments sorted by
View all comments
1
Note: The "flaw" doesn't happen in an xml serialised page when the code is wrapped in a CDATA section.
2 u/ctrldavid Aug 09 '12 Otherwise you should be escaping your < and > characters:var str = "</script><script>alert('Pwned');</script>"; 1 u/kenman Aug 10 '12 Wow, someone should write that down in a guide somewhere.
2
Otherwise you should be escaping your < and > characters:
<
>
var str = "</script><script>alert('Pwned');</script>";
1 u/kenman Aug 10 '12 Wow, someone should write that down in a guide somewhere.
Wow, someone should write that down in a guide somewhere.
1
u/ctrldavid Aug 09 '12
Note: The "flaw" doesn't happen in an xml serialised page when the code is wrapped in a CDATA section.