Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To me, "sanitize" implies a blacklist approach, which is inherently insecure. For the HTML example, it means you're going through and blocking <script> and such, while allowing the rest through. What you should be doing is keeping a small whitelist of allowed tags and blocking everything else, if you must support user-provided HTML in the first place. That to me isn't sanitizing but rather defining an HTML subset and then translating from it to full HTML.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: