manuelz120/CVE-2022-23940

Not Working exploit

Closed this issue · 4 comments

I trying test exploit on suitecrm 7.11.8 with php7.3, but it's not working.
I see 2 problems:

  1. is_array check fails
  2. The data is serialized as a string and deserialized accordingly.

Thanks for reporting. I just verified that the current payload is indeed not working against SuiteCRM 7.11.8.

The vulnerable code-path is still present, but the Monolog/RCE1 payload (generated from https://github.com/ambionics/phpggc) doesn't seem to work. Probably it's using a different version of Monolog and the required classes are not loaded. However, the Monolog/RCE2 payload seems to work for this version.

@vovkarazov123 would you mind verifying if the payload from the suitecrm-7-11-8-poc branch works for your installation?

@manuelz120 Thanks you. Monolog/RCE2 really work. But can you say how work this vulner?
I set some logs:

    public function save($check_notify = false)
    {
        $b = isset($_POST['email_recipients']);
        $a = is_array($_POST['email_recipients']);
        file_put_contents("qweqwe.txt", "ISSET: ".$b." ISARRAY: ".$a."\n",FILE_APPEND);
        if (isset($_POST['email_recipients']) && is_array($_POST['email_recipients'])) {
                file_put_contents("qweqwe.txt", "IM HERE\n", FILE_APPEND);
            $this->email_recipients = base64_encode(serialize($_POST['email_recipients']));
        }

        return parent::save($check_notify);
    }

Variable 'a' not true fnd log message "IM HERE" not in my log file.

@vovkarazov123 yes, for the exploit to work it's important that the code doesn't enter the if branch. It's a good sign that the second log is not triggered. Data is still saved through the parent::save function.

When the data is loaded the next time, it will unserialize the untrusted content within the email_recipients column, which triggers a RCE. So this is pretty much a standard deserialization exploit, as described for example here