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

From the article:

> PyYAML has a .load() method and a .safe_load() method. Why do serialization implementers do this? If you must extend the format with dangerous features, provide them in the non-obvious method. Provide a .load() method and a .dangerous_load() method instead.

I think this is a very good advice that holds in general:

The default should never be the most feature-rich version, but the most safe version. This is also why you should generally prefer a whitelist approach over a blacklist approach. And this is why templating systems should perform escaping by default, forcing you to explicitly disable it, at concrete places, when including raw HTML.



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

Search: