4 ms·
Postel's Law ("Be liberal in what you accept, and conservative in what you send") is a bad idea. You should be conservative in both, which will result in broken
by mrob 6y ago
Postel's Law ("Be liberal in what you accept, and conservative in what you send") is a bad idea. You should be conservative in both, which will result in broken software, but broken software gets fixed. Postel's Law adds avoidable complexity, and complexity is a major source of security vulnerabilities. Unlike broken software, insecure software often stays insecure until it's being actively exploited.
- freehunter 6y agoAs someone who has spent their entire career in infosec, one of my most important rules is “security should break your company”. The alternative is, someone else will break your company for you. If you can’t produce a document that explains what this server does and every external interaction it could possibly have, you’re failing. Be extremely conservative in what you accept. If you’re allowing basically anything in, eventually the wrong person with the wrong code will get in. And that might very well be the last day you have a business.
- miguelmota 6y agoI agree that in general Postel's law is bad practice but I think that it also makes sense under certain contexts. For example, if you have an email input field, it's better to trim spaces from the user input before sending it to the server instead of showing an error that there's spaces needing to be trimmed. In this example the input field is liberal in what it accepts and conservative in what it sends to the server.
- noobermin 6y agoThat might be the issue, what is "liberal" and "conservative" needs to be quantified. Taking Postel's law or any law/adage to an extreme is a bad idea.
- noobermin 6y agoIt seems better to try to ship software that works than ship software that will intentionally break. I get "everything will break" but ensuring it will break sooner and more spectacularly seems like a headache for users.
- david422 6y agoIt's good when dealing with humans, it's bad when dealing with machines. Allow humans a fudge factor for ease of use, but not at the cost of integrity. For instance, allow phone numbers with separators, or spacing, or shortened versions etc. It's aggravating when a form asks for a cc number and allows a user to type spaces but the field has a max length so you have to backtrack and delete all the spaces. Make apis conservative in what they accept. This reduces complexity and the likelihood of bugs.
- MaxBarraclough 6y agoDepends on context. Web browsers are required to cope with old malformed HTML.