Hacker News new | past | comments | ask | show | jobs | submit login

Strict validation could theoretically have helped here, as /FontMatrix is required by the PDF spec to be an array of six numbers. The exploit string was syntactically valid but semantically invalid.

Unfortunately, applications that produce broken PDFs are rife, and Postel's law sets the expectation that we should consume garbage and be happy.




Postel's law should not be applied so broadly, and certainly shouldn't be used as an argument against further validation of inputs.

Garbage inputs are the responsibility of the sender, not the receiver. You can and should accept a small margin of error in inputs where errors may logically appear, but if the receiver accepts too much error then it becomes responsible by creating a complicit norm. If the responsibility of error remains on the sender then introducing further validation is less likely to cause breakage in communication.




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

Search: