Enigma: Fix "decryption oracle" bug [CVE-2019-10740] (#6638)

When composing mail (on reply/forward/edit) we decrypt content only
in the first "content part" of the message.
pull/6748/head
Aleksander Machniak 6 years ago
parent 1ee7253ff2
commit 8fe12e2fad

@ -25,6 +25,7 @@ CHANGELOG Roundcube Webmail
- Managesieve: Fix so "Create filter" option does not show up when Filters menu is disabled (#6723) - Managesieve: Fix so "Create filter" option does not show up when Filters menu is disabled (#6723)
- Enigma: Fix bug where revoked users/keys were not greyed out in key info - Enigma: Fix bug where revoked users/keys were not greyed out in key info
- Enigma: Fix error message when trying to encrypt with a revoked key (#6607) - Enigma: Fix error message when trying to encrypt with a revoked key (#6607)
- Enigma: Fix "decryption oracle" bug [CVE-2019-10740] (#6638)
- Fix so advanced search dialog is not automatically displayed on searchonly addressbooks (#6679) - Fix so advanced search dialog is not automatically displayed on searchonly addressbooks (#6679)
- Fix so an error is logged when more than one attachment plugin has been enabled, initialize the first one (#6735) - Fix so an error is logged when more than one attachment plugin has been enabled, initialize the first one (#6735)
- Fix bug where flag change could have been passed to a preview frame when not expected - Fix bug where flag change could have been passed to a preview frame when not expected

@ -368,20 +368,36 @@ class enigma_engine
*/ */
function part_structure($p, $body = null) function part_structure($p, $body = null)
{ {
static $got_content = false;
// Prevent from "decryption oracle" [CVE-2019-10740] (#6638)
// On mail compose (edit/reply/forward) we support encrypted content only
// in the first "content part" of the message.
if ($got_content && $this->rc->task == 'mail' && $this->rc->action == 'compose') {
return;
}
// Don't be tempted to support encryption in text/html parts // Don't be tempted to support encryption in text/html parts
// Because of EFAIL vulnerability we should never support this (#6289) // Because of EFAIL vulnerability we should never support this (#6289)
if ($p['mimetype'] == 'text/plain' || $p['mimetype'] == 'application/pgp') { if ($p['mimetype'] == 'text/plain' || $p['mimetype'] == 'application/pgp') {
$this->parse_plain($p, $body); $this->parse_plain($p, $body);
$got_content = true;
} }
else if ($p['mimetype'] == 'multipart/signed') { else if ($p['mimetype'] == 'multipart/signed') {
$this->parse_signed($p, $body); $this->parse_signed($p, $body);
$got_content = true;
} }
else if ($p['mimetype'] == 'multipart/encrypted') { else if ($p['mimetype'] == 'multipart/encrypted') {
$this->parse_encrypted($p); $this->parse_encrypted($p);
$got_content = true;
} }
else if ($p['mimetype'] == 'application/pkcs7-mime') { else if ($p['mimetype'] == 'application/pkcs7-mime') {
$this->parse_encrypted($p); $this->parse_encrypted($p);
$got_content = true;
}
else {
$got_content = $p['structure']->type === 'content';
} }
return $p; return $p;

Loading…
Cancel
Save