<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>404698</bug_id>
          
          <creation_ts>2019-02-22 12:52:18 +0000</creation_ts>
          <short_desc>Decryption Oracle based on replying to PGP or S/MIME encrypted emails</short_desc>
          <delta_ts>2019-07-31 02:15:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>crypto</component>
          <version>unspecified</version>
          <rep_platform>Debian stable</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jens Mueller">jens.a.mueller+kde</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>aacid</cc>
    
    <cc>asturm</cc>
    
    <cc>beuc</cc>
    
    <cc>dvratil</cc>
    
    <cc>faure</cc>
    
    <cc>montel</cc>
    
    <cc>nate</cc>
    
    <cc>null+samzain</cc>
    
    <cc>rdieter</cc>
    
    <cc>sknauss</cc>
    
    <cc>stupor_scurvy343</cc>
          
          <cf_commitlink>https://commits.kde.org/messagelib/ac360b3a57eacbf0542ed0800e6054db76f01398</cf_commitlink>
          <cf_versionfixedin>5.11.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1839744</commentid>
    <comment_count>0</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-02-22 12:52:18 +0000</bug_when>
    <thetext>In the scope of academic research in cooperation with Ruhr-Uni Bochum and FH Münster, Germany we discovered a security issue in KMail: An attacker who is in possession of PGP or S/MIME encrypted messages can embed them into a multipart message and re-send them to the intended receiver. When the message is read and decrypted by the receiver, the attacker&apos;s content is shown. If the victim replies, the plaintext is leaked to an attacker&apos;s email address. The root cause for these vulnerabilities lies in the way KMail (and many other mail clients) handle partially encrypted multipart messages.

-----------------------------------------
*Leaking plaintext through reply/forward*
-----------------------------------------

/Attacker model/: Attacker is in possession of PGP or S/MIME encrypted messages, which she may have obtained as passive man-in-the-middle or by actively hacking into the victim&apos;s mail server or gateway

/Attacker&apos;s goal/: Leak the plaintext by wrapping the ciphertext part within a benign-looking MIME mail sent to and decrypted+replied to by the victim

/Attack outline:/ If KMail receives a multipart email, as depicted below, it decrypt the ciphertext part(s), together with the attacker-controlled text (which may be prepended and/or appended).

multipart/mixed
   |--- Attacker&apos;s part
   |--- [encrypted part to leak]
   +--- [Attacker&apos;s encrypted part]

A benign-looking attacker&apos;s text may lure the victim into replying. Because the decrypted part is also quoted in the reply, the user unintentionally acts as a decryption oracle. To obfuscate the existence of the encrypted part(s), the attacker may add a lot of newlines or hide it within a long conversation history. A user replying to such a ‘mixed content’ conversation thereby leaks the plaintext of encrypted messages wrapped within attacker-controlled text.

Please find attached a raw .eml file which depicts the issue.

---------------
Countermeasures
---------------

Do not decrypt emails unless the PGP or S/MIME encrypted part is the root node -- and therefore the only part -- in the MIME tree (exception: multipart/signed for encrypted-then-signed S/MIME messages). Another, potentially less secure, option would be to quote only the very first MIME part in replies.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839745</commentid>
    <comment_count>1</comment_count>
      <attachid>118288</attachid>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-02-22 12:52:40 +0000</bug_when>
    <thetext>Created attachment 118288
Proof-of-concept PGP</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839746</commentid>
    <comment_count>2</comment_count>
      <attachid>118289</attachid>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-02-22 12:52:53 +0000</bug_when>
    <thetext>Created attachment 118289
Proof-of-concept S/MIME</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1849273</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Vrátil">dvratil</who>
    <bug_when>2019-04-08 16:55:35 +0000</bug_when>
    <thetext>In KMail this attack requires that user would enable &quot;Automatic decryption of encrypted messages when viewing&quot; option in KMail settings, which is disabled by default.

Without this option enabled the user has to click on &quot;Decrypt&quot; on the part that the attacker wants to leak. At this point, the user will still clearly see which part of the content was encrypted and which part was not. When the user wants to reply to this decrypted message, the content would indeed get leaked to the attacker. However, I believe that at this point KMail has done enough to prevent (by not enabling auto-decryption by default) and warn (by clearly showing which part is encrypted and which not) the user so he or she could judge for themselves the potential risks when replying to the message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1849484</commentid>
    <comment_count>4</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-04-09 15:41:27 +0000</bug_when>
    <thetext>Things may have changed in the meantime, but for the version we tested (v5.2.3), there is no need to click on &quot;Decrypt Message&quot;. While the plaintext is not shown to the user, if he does not explicitly click &quot;Decrypt Message&quot;, the plaintext is still included in replies -- just re-tested for S/MIME and PGP/MIME. Note that KMail was tested in the default settings (the option &quot;Attempt decryption of encrypted messages when viewing&quot; was *not* set).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1849561</commentid>
    <comment_count>5</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-04-09 20:54:50 +0000</bug_when>
    <thetext>(In reply to Daniel Vrátil from comment #3)
&gt; In KMail this attack requires that user would enable &quot;Automatic decryption
&gt; of encrypted messages when viewing&quot; option in KMail settings, which is
&gt; disabled by default.

As Jens already explained, this setting does not help here. This Setting only do not trigger decryption directly when you view the mail. But if you reply the mail is decrypted in anycase. And we use the same code paths for rendering the view and prepare the reply/forward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850137</commentid>
    <comment_count>6</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2019-04-13 10:39:21 +0000</bug_when>
    <thetext>I am not sure I understand where the problem is, potentially means you need to explain it in simpler words (or that i need to learn how to read long sentences :D)

Is this problem?
 * A sends encrypted email to B
 * C intercepts that email
 * C resends the email modified to B (adding his own reply address and some plain text)
 * B answers to C
 * C can see the original email</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850145</commentid>
    <comment_count>7</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-04-13 12:29:02 +0000</bug_when>
    <thetext>Exactly that&apos;s the problem. Note that not only one message, but hundreds of captured messages can be wrapped and leaked with one single reply.

Traditional message takeover attacks under a new identity (C) are considered as an acceptable risk in email e2e encryption because it is assumed that given the context of the message (e.g.,“Hi A, [...] Yours, B”) B can tell that this message is not originally from C and could easily discover the deception. However, using MIME wrapping, C can make a different content being displayed to B (if B does not carefully scroll down the whole message conversation) and therefore potentially trick B into replying to C.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850523</commentid>
    <comment_count>8</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2019-04-15 21:36:49 +0000</bug_when>
    <thetext>Right i can see the problem.

Question is, are those kind of messages that you are suggesting to stop supporting &quot;common&quot; or even is there a reason for someone to be sending messages like that?

Or if you get a message like this it&apos;s most probably someone trying to trick you?

Because if those messages are common, stopping to work on them is going to be a pain for the people that have a valid usecase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850592</commentid>
    <comment_count>9</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-04-16 09:06:50 +0000</bug_when>
    <thetext>Imho, there are no legitimate use cases for `partial encryption` in S/MIME and PGP/MIME, but it&apos;s hard to measure if such emails do exist in the wild. In case of PGP/Inline, unfortunately, every part is encrypted separately. Note that a captured PGP/MIME message can be `downgraded` to be interpreted in the context of PGP/INLINE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851106</commentid>
    <comment_count>10</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-04-18 13:30:36 +0000</bug_when>
    <thetext>Update: Here&apos;s a full (public) report on the issue:
https://arxiv.org/ftp/arxiv/papers/1904/1904.07550.pdf

For KMail, CVE-2019-10732 was assigned for reply-based `decryption oracles`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851642</commentid>
    <comment_count>11</comment_count>
    <who name="David Faure">faure</who>
    <bug_when>2019-04-21 17:14:23 +0000</bug_when>
    <thetext>Interesting problem. Here&apos;s my feedback.

- Preventing KMail from *sending* such messages would obviously be no help (one could just craft that message by hand or using another email client). 

- Preventing the user from replying to such a message would be very weird user experience (sorry, you are not allowed to reply to this message!)

- So I guess the best solution is that when replying, we don&apos;t decrypt parts that were encrypted in the original message. I.e. if we are replying with a copy of those parts, and they were encrypted, they should be copied &quot;as is&quot;. This would prevent any newly-added recipient from reading those, but that&apos;s fair enough I would say.
I wouldn&apos;t really know how to implement this though.
Might be tricky if the tree in memory only has the decrypted version.

- Alternatively, KMail could say &quot;for security reasons, these parts are going to be removed from your reply&quot;. But this also requires that we somehow know that these parts used to be encrypted in the original email.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851728</commentid>
    <comment_count>12</comment_count>
    <who name="David Faure">faure</who>
    <bug_when>2019-04-22 09:31:07 +0000</bug_when>
    <thetext>About the original suggestion: &quot;Do not decrypt emails unless the PGP or S/MIME encrypted part is the root node -- and therefore the only part -- in the MIME tree (exception: multipart/signed for encrypted-then-signed S/MIME messages).&quot;

This would mean if you attach a non-encrypted image (say, company logo) to an encrypted email, the recipient can&apos;t reply to the email anymore? I think we always want to decrypt the main text part? (fuzzy term, I don&apos;t know what the actual logic is in kmail, but I mean the text that gets quoted).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851915</commentid>
    <comment_count>13</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-04-22 21:21:16 +0000</bug_when>
    <thetext>@Jens: what version did you test? You set &quot;Debian Stable&quot; and &quot;5.10.3&quot; this does not match. Debian stable has 16.04.3 aka 5.2.3. 

I now started to look into the issue, but I can&apos;t reproduce it with the attached messages for 18.08.3 nor for master. At least for the encrypted content to be simple text. Do I need to construct a mimetree inside the encrypted message parts?
And this make totally sense, as we have already have the concept of firstTextNode inside ObjectTreeParser, that takes effect here.

I added the proof-of-concept mails to our autotests: 
  https://phabricator.kde.org/D20757
the plain.reply files are the output of the reply window.

For those you have a test environment for messagelib, those can view such mails and reply/forward:

GNUPGHOME=&lt;buildpath of messagelib&gt;/messagecore/autotests/gnupg_home/ kmail --view 404698-gpg.mbox

A short explanation, how a reply/forward is created (everything in messagelib):
* templateparser/src/templateparserjob constructs a new KMime::Message mMsg from a given mOrigMsg.
* TemplateParserJob uses MimeTreeParser::ObjectTreeParser to get htmlContent/plainTextContent. At least for plainTextContent it is easy to follow, that only the content from first text node is used. For htmlContent it looks, like we merge different htmlNodes via messagepart.cpp:HtmlMessagePart::fix()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851921</commentid>
    <comment_count>14</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-04-22 21:44:01 +0000</bug_when>
    <thetext>(In reply to David Faure from comment #11)
&gt; - Preventing KMail from *sending* such messages would obviously be no help
&gt; (one could just craft that message by hand or using another email client). 

ACK.

&gt; - Preventing the user from replying to such a message would be very weird
&gt; user experience (sorry, you are not allowed to reply to this message!)

jepp bad UX.

&gt; - So I guess the best solution is that when replying, we don&apos;t decrypt parts
&gt; that were encrypted in the original message. I.e. if we are replying with a
&gt; copy of those parts, and they were encrypted, they should be copied &quot;as is&quot;.
&gt; This would prevent any newly-added recipient from reading those, but that&apos;s
&gt; fair enough I would say.
&gt; I wouldn&apos;t really know how to implement this though.
&gt; Might be tricky if the tree in memory only has the decrypted version.
&gt;
&gt; - Alternatively, KMail could say &quot;for security reasons, these parts are
&gt; going to be removed from your reply&quot;. But this also requires that we somehow
&gt; know that these parts used to be encrypted in the original email.

Both things are not that hard to solve. We have MimeTreeParser::ObjecttreeParser that returns a MessagePart tree. This is a tree, where only visual interesting nodes of the Mime messages with the additional information of each node, about their encrypted status, used keys etc... To get an idea about those trees look at mimetreeparser/autotests/data/*tree files, these are the MessagePart tree for the corresponding mbox. Also TemplateParser, that is responsible for creating a reply/template, uses MimeTreeParser::ObjecttreeParser, so we are able to filter out bad nodes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1852779</commentid>
    <comment_count>15</comment_count>
    <who name="Jens Mueller">jens.a.mueller+kde</who>
    <bug_when>2019-04-26 10:09:00 +0000</bug_when>
    <thetext>@David: This would mean if you attach a non-encrypted image to an encrypted...

Absolutely, such an email could not be decrypted anymore if you follow our suggestions (or had to be manually decrypted on the command line). While this may seem a bit harsh, we have not seen any mail client that allows to send such &quot;partially encrypted&quot; emails (e.g., with unencrypted attachments), and I think handling such edge cases can become a security nightmare. Either the whole mail is encrypted or it&apos;s not, everything else gives a false sense of security, imho.

However, I see the developer&apos;s perspective and the and the fear of potentially breaking things, too. I guess a rule like &quot;in case of an encrypted, multipart email, reply only with the first part&quot; *should* be fine too.

@Sandro: We originally tested in version 5.2.3 on Debian 9.8 (stretch). This version is probably outdated by now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1852785</commentid>
    <comment_count>16</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-04-26 11:00:21 +0000</bug_when>
    <thetext>(In reply to Jens Mueller from comment #15)
&gt; @David: This would mean if you attach a non-encrypted image to an
&gt; encrypted...
&gt; 
&gt; Absolutely, such an email could not be decrypted anymore if you follow our
&gt; suggestions (or had to be manually decrypted on the command line). While
&gt; this may seem a bit harsh, we have not seen any mail client that allows to
&gt; send such &quot;partially encrypted&quot; emails (e.g., with unencrypted attachments),
&gt; and I think handling such edge cases can become a security nightmare. Either
&gt; the whole mail is encrypted or it&apos;s not, everything else gives a false sense
&gt; of security, imho.

One client that supports sending encrypted mails with unencrypted attachment is kmail (but you need to do it explicitly).

One common use case, of such partial encrypted mails are mails forwarded via Mailman. Mailman adds a non encrypted footer to each email. So not supporting these mails make would break my workflow. This was the reason, why I fixed a several things, because I didn&apos;t wanted to see this footer in the reply ;D And I see a big difference between displaying such broken mails and replying. 

&gt; However, I see the developer&apos;s perspective and the and the fear of
&gt; potentially breaking things, too. I guess a rule like &quot;in case of an
&gt; encrypted, multipart email, reply only with the first part&quot; *should* be fine
&gt; too.

I think so, too, that reply to only one part you be fine.

&gt; @Sandro: We originally tested in version 5.2.3 on Debian 9.8 (stretch). This
&gt; version is probably outdated by now.

yes! Did you tested any other version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855745</commentid>
    <comment_count>17</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-05-12 21:59:21 +0000</bug_when>
    <thetext>Git commit d397aa46e809203c94e31891caac57affac746d9 by Sandro Knauß.
Committed on 12/05/2019 at 20:34.
Pushed by knauss into branch &apos;Applications/19.04&apos;.

Test mails for Decryption Oracle based on replying to PGP or S/MIME.

Summary:
In order to make sure we never add a Decryption Oracle add test mails to
TemplateParser.

Reviewers: #kde_pim, aacid, dfaure

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D20757

A  +120  -0    templateparser/autotests/data/404698-gpg.mbox
A  +51   -0    templateparser/autotests/data/404698-gpg.mbox.plain.reply
A  +88   -0    templateparser/autotests/data/404698-smime.mbox
A  +51   -0    templateparser/autotests/data/404698-smime.mbox.plain.reply

https://commits.kde.org/messagelib/d397aa46e809203c94e31891caac57affac746d9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855754</commentid>
    <comment_count>18</comment_count>
      <attachid>120026</attachid>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-05-12 22:10:25 +0000</bug_when>
    <thetext>Created attachment 120026
html mail with two images embeded.

There is one question, how we should handle forwards with embedded images.
We have a testcase with two images embedded (see attachment), that are added to the forwarded message. IMO this is not a security issue, as we do not parse those two images (aka do not encrypt them) and just copy them like they were sent over the wire. So we can&apos;t leak private information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855757</commentid>
    <comment_count>19</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-05-12 22:14:40 +0000</bug_when>
    <thetext>Git commit a58286aec8f300d78c570726924baa91d9a22771 by Sandro Knauß.
Committed on 12/05/2019 at 21:48.
Pushed by knauss into branch &apos;Applications/19.04&apos;.

Merge branch &apos;CVE-2019-10732&apos; into Applications/19.04

Fixes the CVE-2019-10732, with additional tests, to make sure, we fixed
the CVE completely.

FIXED-IN: 5.11.2
CCMAIL: security@kde.org


https://commits.kde.org/messagelib/a58286aec8f300d78c570726924baa91d9a22771</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855758</commentid>
    <comment_count>20</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-05-12 22:14:40 +0000</bug_when>
    <thetext>Git commit 8f9b85b664be0987014c5d2485e706ab5a198e1b by Sandro Knauß.
Committed on 12/05/2019 at 20:37.
Pushed by knauss into branch &apos;Applications/19.04&apos;.

Make unexpected data leak harder via reply.

ObjectTreeParser.htmlContent/plainTextContent may concats different encrypted parts
without the user noticing it. That would lead to a Decryption oracle. We have already
a logic to find the topleveltextNode in MimeTreeParser, this does not take HTML nodes
into account nor that TEXT nodes may have several PGP Inline blocks.

That plaintextContent for HtmlMessagePart is not return QString(), that bubbled up by
testing the stuff.

M  +5    -0    mimetreeparser/src/messagepart.cpp
M  +1    -0    mimetreeparser/src/messagepart.h
A  +31   -0    templateparser/autotests/data/openpgp-inline-space.mbox
A  +1    -0    templateparser/autotests/data/openpgp-inline-space.mbox.html.reply
A  +1    -0    templateparser/autotests/data/openpgp-inline-space.mbox.plain.reply
M  +46   -14   templateparser/src/templateparserjob.cpp

https://commits.kde.org/messagelib/8f9b85b664be0987014c5d2485e706ab5a198e1b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855759</commentid>
    <comment_count>21</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-05-12 22:14:43 +0000</bug_when>
    <thetext>Git commit ac360b3a57eacbf0542ed0800e6054db76f01398 by Sandro Knauß.
Committed on 12/05/2019 at 20:37.
Pushed by knauss into branch &apos;Applications/19.04&apos;.

Decryption Oracle based on forwarding PGP or S/MIME mails (CVE-2019-10732)

Summary:
Add test coverage for mail forwarding.

Test Plan:
all tests passes
forward (text/html):
[x] PGP Mime text
[x] PGP Mime html
[x] S/MIME
[x] PGP inline

Reviewers: #kde_pim, vkrause, aacid, dfaure

Subscribers: kde-pim, security-team

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D20847

A  +72   -0    templateparser/autotests/data/404698-gpg-attachments.mbox
A  +66   -0    templateparser/autotests/data/404698-gpg-attachments.mbox.forwarded.mbox
A  +1    -0    templateparser/autotests/data/404698-gpg-attachments.mbox.html.reply
A  +5    -0    templateparser/autotests/data/404698-gpg-attachments.mbox.plain.reply
A  +83   -0    templateparser/autotests/data/html-attachment1.mbox.forwarded.mbox
A  +28   -0    templateparser/autotests/data/html-attachment2.mbox.forwarded.mbox
M  +162  -0    templateparser/autotests/templateparserjobtest.cpp
M  +9    -0    templateparser/autotests/templateparserjobtest.h

https://commits.kde.org/messagelib/ac360b3a57eacbf0542ed0800e6054db76f01398</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862350</commentid>
    <comment_count>22</comment_count>
    <who name="">beuc</who>
    <bug_when>2019-06-12 14:59:32 +0000</bug_when>
    <thetext>Hi,

As part of the Debian LTS project, I&apos;m trying to fix this vulnerability in Debian Jessie, which ships kdepim 4.14.1.

I&apos;m attempting to backport
https://commits.kde.org/messagelib/8f9b85b664be0987014c5d2485e706ab5a198e1b
but the API is very different, I&apos;m not even sure there are available functions to expose the MIME parts and extract their quotable content independently.

Do you think this is doable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862386</commentid>
    <comment_count>23</comment_count>
    <who name="">beuc</who>
    <bug_when>2019-06-12 18:57:26 +0000</bug_when>
    <thetext>I wrote something cruder but that works with the 404698-* messagelib test cases:
https://www.beuc.net/tmp/kdepim-CVE-2019-10732.patch
This should be a good compromise, let me know if I missed something.
I plan to upload an update shortly, probably next week :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1866082</commentid>
    <comment_count>24</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2019-06-28 15:38:27 +0000</bug_when>
    <thetext>(In reply to beuc from comment #23)
&gt; I wrote something cruder but that works with the 404698-* messagelib test
&gt; cases:
&gt; https://www.beuc.net/tmp/kdepim-CVE-2019-10732.patch
&gt; This should be a good compromise, let me know if I missed something.
&gt; I plan to upload an update shortly, probably next week :)

The code looks like it should be enough. But the surrounding code has changed a lot between 4.14.1 and had less tests etc. It may be that there are other things to fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872141</commentid>
    <comment_count>25</comment_count>
    <who name="removed by sysadmin">null+samzain</who>
    <bug_when>2019-07-31 02:15:35 +0000</bug_when>
    <thetext></thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>118288</attachid>
            <date>2019-02-22 12:52:40 +0000</date>
            <delta_ts>2019-02-22 12:52:40 +0000</delta_ts>
            <desc>Proof-of-concept PGP</desc>
            <filename>00-pgp-mime-reply-mix-crlf.eml</filename>
            <type>message/rfc822</type>
            <size>1996</size>
            <attacher name="Jens Mueller">jens.a.mueller+kde</attacher>
            
              <data encoding="base64">U3ViamVjdDogVGVzdGNhc2UgJ3JlcGx5LW1peC1jcmxmJyAoUEdQL01JTUUpClRvOiBicnVjZXdh
eW5lNDVAd2ViLmRlCkZyb206IGJydWNld2F5bmU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JZCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L2VuY3J5cHRlZDsgcHJvdG9jb2w9ImFw
cGxpY2F0aW9uL3BncC1lbmNyeXB0ZWQiOyBib3VuZGFyeT0iREVMSU1JVEVSIgoKLS1ERUxJTUlU
RVIKQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9wZ3AtZW5jcnlwdGVkCgpWZXJzaW9uOiAxCgot
LURFTElNSVRFUgpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTsgbmFtZT0i
ZW5jcnlwdGVkLmFzYyIKQ29udGVudC1EaXNwb3NpdGlvbjogaW5saW5lOyBmaWxlbmFtZT0iZW5j
cnlwdGVkLmFzYyIKCltBVFRBQ0tFUlMgRU5DUllQVEVEIE1FU1NBR0VdCgotLURFTElNSVRFUi0t
Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>118289</attachid>
            <date>2019-02-22 12:52:53 +0000</date>
            <delta_ts>2019-02-22 12:52:53 +0000</delta_ts>
            <desc>Proof-of-concept S/MIME</desc>
            <filename>00-smime-reply-mix-crlf.eml</filename>
            <type>message/rfc822</type>
            <size>1602</size>
            <attacher name="Jens Mueller">jens.a.mueller+kde</attacher>
            
              <data encoding="base64">U3ViamVjdDogVGVzdGNhc2UgJ3JlcGx5LW1peC1jcmxmJyAoUy9NSU1FKQpUbzogYnJ1Y2V3YXlu
ZTQ1QHdlYi5kZQpGcm9tOiBicnVjZXdheW5lNDVAd2ViLmRlCk1JTUUtVmVyc2lvbjogMS4wCkNv
bnRlbnQtVHlwZTogbXVsdGlwYXJ0L21peGVkOyBib3VuZGFyeT0iQk9VTkRBUlkiCgotLUJPVU5E
QVJZCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbgoKUGxlYXNlIHJlcGx5IHRvIHRoaXMgbWVzc2Fn
ZQouCi4KLgouCi4KLgouCi4KLgouCi4KLgouCi4KLgouCi4KLg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JVGxBRGZzZUEzMnZpTXY2R3F1WWgwVUFiRTR5eDln
MFEvdWFWZFBFVlpLbmRaT2w1SjcxYWtuV1RDQUJna3EKaGtpRzl3MEJCd0V3RkFZSUtvWklodmNO
QXdjRUNBTEFLTWliZ0REeW9JQUVnYkFsM3o2YmxwTy9QdmljcDN3MkZOVmJodGhhCkZiU3hBSVZD
TE9VVkxXbzlLajJsaEVsc29PcGhjdkN3TWZoRm1YNlU0dkxiUzVGMWRwSmxRVm1iV29KUzlHcUpx
aUd6Y3E2egozRGU4cXUwM0NDNjdFOWpESUtDNDYwT3RGeENyKzBBQ0tidmxqd1NvUmh3a0E5ZjB1
OW9OWWVJTUlRQW9tRkZJQytIcDEvcm8KUWl6SG9FL09jSXBWU0ttb2dzcDVlTVhjcWtVZU1zS0hx
Z0M4TWNUNTExQVFSSDAzeTZuQStDeEpMYnMydTRvN1BBUUlJbFNlClF6WmNnSlVBQUFBQUFBQUFB
QUFBCgotLUJPVU5EQVJZCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vcGtjczctbWltZTsgbmFt
ZT0ic21pbWUucDdtIjsgc21pbWUtdHlwZT1lbnZlbG9wZWQtZGF0YQpDb250ZW50LVRyYW5zZmVy
LUVuY29kaW5nOiBiYXNlNjQKCltBVFRBQ0tFUlMgRU5DUllQVEVEIE1FU1NBR0VdCgotLUJPVU5E
QVJZLS0K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>120026</attachid>
            <date>2019-05-12 22:10:25 +0000</date>
            <delta_ts>2019-05-12 22:10:25 +0000</delta_ts>
            <desc>html mail with two images embeded.</desc>
            <filename>html-attachment2.mbox</filename>
            <type>application/mbox</type>
            <size>859</size>
            <attacher name="Sandro Knauß">sknauss</attacher>
            
              <data encoding="base64">RnJvbSBtYWlsbGlzdHNAd2hhdHRmLmNvbSAgVHVlIEp1bCAwNSAxOToyMDo1OCAyMDExClJldHVy
bi1wYXRoOiA8bWFpbGxp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