Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Bug #21215 "multipart/signed" messages decoding issue
Submitted: 2017-05-31 13:11 UTC
From: sgironella Assigned:
Status: Open Package: Mail_mimeDecode (version 1.5.6)
PHP Version: 5.6.30 OS: FreeBSD 11
Roadmaps: (Not assigned)    
Subscription  


 [2017-05-31 13:11 UTC] sgironella (Stefano Gironella)
Description: ------------ On "multipart/signed" messages, "_decode()" method doesn't return a parts list but an associative array ("msg_body", "sig_hdr", "sig_body"); this lead "getMimeNumbers()" method to an infinite loop as it expects to iterate over a parts list and it doesn't manage those keys. See the case "case 'multipart/signed': // PGP" at line 324 Actual result: -------------- [31-May-2017 12:41:33 Europe/Rome] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /webroot/vendor/pear-pear.php.net/Mail_mimeDecode/Mail/mimeDecode.php on line 425 [31-May-2017 12:41:33 Europe/Rome] PHP Stack trace: [31-May-2017 12:41:33 Europe/Rome] PHP 1. {main}() /webroot/index.php:0 [31-May-2017 12:41:33 Europe/Rome] PHP 2. include_once() /webroot/index.php:291 [31-May-2017 12:41:33 Europe/Rome] PHP 3. rcube_message->__construct() /webroot/program/steps/mail/show.inc:49 [31-May-2017 12:41:33 Europe/Rome] PHP 4. rcube_dbmail->get_message() /webroot/program/lib/Roundcube/rcube_message.php:94 [31-May-2017 12:41:33 Europe/Rome] PHP 5. rcube_dbmail->retrieve_message() /webroot/program/lib/Roundcube/rcube_dbmail.php:1100 [31-May-2017 12:41:33 Europe/Rome] PHP 6. rcube_dbmail->decode_raw_message() /webroot/program/lib/Roundcube/rcube_dbmail.php:4316 [31-May-2017 12:41:33 Europe/Rome] PHP 7. Mail_mimeDecode->getMimeNumbers() /webroot/program/lib/Roundcube/rcube_dbmail.php:5425 [31-May-2017 12:41:33 Europe/Rome] PHP 8. Mail_mimeDecode->getMimeNumbers() /webroot/vendor/pear-pear.php.net/Mail_mimeDecode/Mail/mimeDecode.php:415

Comments

 [2017-06-01 07:06 UTC] alan_k (Alan Knowles)
Can you suggest a patch
 [2017-06-01 07:21 UTC] sgironella (Stefano Gironella)
 [2018-02-21 19:51 UTC] soul__reaver (Soul Reaver)
Roundcube could also fix this by adding an extra check in decode_raw_message to check this before calling getMimeNumbers in EmailReporting i fixed it like this https://github.com/mantisbt-plugins/EmailReporting/blob/master/core/Mail/Parser.php#L257 https://github.com/mantisbt-plugins/EmailReporting/blob/master/core/Mail/Parser.php#L236