opsxcq/exploit-CVE-2016-10033

why we can't use additional_parameters in safe_mode?

falconz opened this issue · 7 comments

when I see to if else condition
if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
$result = @mail($to, $subject, $body, $header);
} else {
$result = @mail($to, $subject, $body, $header, $params);
}

in this case, I think if safe_mod is ON but $this->UseSendmailOptions is TRUE , the second condition "$result = @mail($to, $subject, $body, $header, $params);" still be processed
at 176 line code in class.phpmailer.php: "public $UseSendmailOptions = true;'

Can you elaborate ? I didn't understand your point.

in readme.md you said that "Then, the code flow goes to mailPassthru() function, which, if running in safe_mode won't be vulnerable to this flaw, as the following code states it"

Why?

because of this line

if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {

but !$this->UseSendmailOptions is alway TRUE so when safe_mode FALSE, this line still happened

!$this->UseSendmailOptions

is false in this scenario, look closer, there is a ! in the front of the variable.

oh! sorry ! I got it. thank you!

No problem ! For any further investigation, if you need, you can just use error_log("string"); , regenerate the imagem and run the exploit against it. So you will be able to see the execution flow.