News for hackers. Stuff that matters.
Re:Mern: Build JavaScript apps using React and Redux by rohanprabhu on Thursday February 18, 2016 @04:32AM (#11124634)
Not sanitizing input, by either scrubbing out any <script> tags, or escaping those characterst to html entities.
Re:Mern: Build JavaScript apps using React and Redux by kolme on Thursday February 18, 2016 @04:53AM (#11124708)
Please don't "sanitize" input, just escape accordingly.

"<script>" might be a legitimate input.

Re:Mern: Build JavaScript apps using React and Redux by eterm on Thursday February 18, 2016 @08:38AM (#11125602)
You need both. Sometimes the legit input is HTML such as from rich text editors. In those cases if someone types a bold <script> then the form should submit the escaped <b>&lt;script&gt;<b> but also needs to sanitise to make sure that other HTML element types are not present.

If you escape one step further you'll lose formatting or the message, so sanitisation is important too, it is reductive to say "always escape never sanitise".

Re:Mern: Build JavaScript apps using React and Redux by windsurfer on Thursday February 18, 2016 @11:32AM (#11126914)
I think your first problem is whitelisting HTML entities. Unless you're composing HTML-formatted email, it's usually better to use a different markup syntax like a minimal markdown or asciidoc that can safely be escaped.
Re:Mern: Build JavaScript apps using React and Redux by eterm on Thursday February 18, 2016 @01:59PM (#11128291)
I agree, although for non-technical users, the better wysiwyg editors are still HTML based, unless you have a recommendation for an in-browser wysiwyg editor that returns/exports markdown?