Quotes of the week
Quotes of the week
Posted Jun 3, 2010 18:20 UTC (Thu) by viro (subscriber, #7872)In reply to: Quotes of the week by spender
Parent article: Quotes of the week
1) program that blindly does open()/creat() on directory/something, etc. is certainly in for the world of hurt if directory is writable to somebody else and yes, there's a looong list of exploits based on that.
2) in all these exploits shit hits the fan on the final pathname component.
3) if a program is broken enough to attempt such open()/creat() when it can't even rely on _earlier_ steps in pathname resolution, it's _really_ in trouble; it can be attacked in a lot more ways. Fortunately, that tends to be less frequent.
4) posted patch attempts to apply checks to *ALL* symlink traversals, final or not.
5) for the cases that fall under (2), the patch is an overkill and misplaced; the proper place for these checks is in do_filp_open() loop where we deal with trailing symlink case.
6) for really broken cases (i.e. (3)), it's not going to be anywhere near enough, for all the obvious reasons.
In other words, if that patch claims to deal with attacker-controllable symlinks on *ALL* steps of pathname resolution, the checks are insufficient. If it cares only about the attacker-controllable symlinks on the final step, the checks are misplaced.
Should I spell that in further details or would that suffice?
