< Return to Video

35C3 - Attacking end-to-end email encryption

  • 0:00 - 0:18
    35C3 preroll music
  • 0:18 - 0:24
    Herald: The following talk is about email
    encryption. Who worries that their email
  • 0:24 - 0:33
    encryption might be capable of being
    hacked or cracked? Worry not as far as I'm
  • 0:33 - 0:40
    told it still is rather secure. But. And
    the but will be answered by Sebastian
  • 0:40 - 0:46
    Schinzel who is one of the eight security
    researchers who uncovered the drama and
  • 0:46 - 0:55
    the details behind e-fail. A recently
    occurred issue with OpenPGP and S/MIME
  • 0:55 - 1:00
    in a lot of email clients. All the
    technical details he will dig into so
  • 1:00 - 1:03
    please give a warm hand of applause for
    Sebastian Schinzel.
  • 1:03 - 1:10
    applause
  • 1:10 - 1:15
    Sebastian: So it's good to be back. Thank
    you everyone for coming. My name is
  • 1:15 - 1:22
    Sebastian. It's my fourth talk here at the
    CCC. And the other talks that I did were
  • 1:22 - 1:27
    also on encryption so I somehow like
    encryption and I like analyzing encryption
  • 1:27 - 1:31
    and I like to break encryption. So I did a
    talk on TLS where we found an attack
  • 1:31 - 1:39
    against TLS and against XML encryption for
    example. And I usually start my talk by
  • 1:39 - 1:45
    asking Who's using this this specific
    technology, right? Because when you when
  • 1:45 - 1:50
    you usually when you're analyzing or doing
    a talk about a communication protocol you
  • 1:50 - 1:57
    ask the people who's using that and you
    know for e-mail it would be silly, right?
  • 1:57 - 2:00
    Because, who's using e-mail.
    Every one of you is using e-mail.
  • 2:00 - 2:05
    OK. Because I don't know. I mean when you
    started using the Internet like
  • 2:05 - 2:10
    in the last 20 years or so usually
    the first thing that you do you dial in
  • 2:10 - 2:13
    onto the Internet and you make
    yourself an e-mail address, right?
  • 2:13 - 2:21
    So everyone has everyone uses e-mail. But
    let's take a look at how things work when
  • 2:21 - 2:25
    when you send an email. So when you click
    in your email client when you when you
  • 2:25 - 2:30
    compose an email and you click into your
    email client "Send". So the first thing is
  • 2:30 - 2:35
    on one of your devices you're using the
    local network and there's a green arrow
  • 2:35 - 2:41
    because it's under your control. So you
    can define by yourself how secure this
  • 2:41 - 2:46
    link is gonna be. Then you use the next
    connection and the next connection will be
  • 2:46 - 2:50
    to your SMTP server. And this is also a
    green arrow because it's under your control.
  • 2:50 - 2:53
    Okay. You can control this
    and usually it's TLS.
  • 2:53 - 2:59
    The same as valid for your IMAP
    folder because always when you send an
  • 2:59 - 3:07
    email via SMTP you will upload a copy to
    your "sent" folder on IMAP and it uses TLS
  • 3:07 - 3:12
    in most of the cases so therefore the
    arrow is green. The arrow is not that
  • 3:12 - 3:18
    green anymore when it comes to the backup
    strategy for example an archiving strategy
  • 3:18 - 3:24
    of your email provider which may be gmail
    or gmx for example or your company. OK.
  • 3:24 - 3:27
    But you may have a chance to know the
    administrators and ask him whether they
  • 3:27 - 3:34
    are doing a good job and stuff like
    that. You're also - it's not under your
  • 3:34 - 3:39
    control where else your email is uploaded
    to. So for example in order to check it
  • 3:39 - 3:45
    for antivirus or anti spam and stuff like
    that, right? So it gets uploaded to some
  • 3:45 - 3:50
    cloud, right? Because you want to do a
    spam filtering and then it goes out to the
  • 3:50 - 3:54
    Internet and you know we learned what's
    happening on the Internet. People are
  • 3:54 - 4:00
    listening in on the Internet and we heard
    from Edward Snowden for example that many
  • 4:00 - 4:05
    nation state actors and agencies are
    doing this as well they are listening into
  • 4:05 - 4:12
    your e-mails or they at least try to. And
    then the arrows get red as soon as it hits
  • 4:12 - 4:16
    the SMTP server of the receiver. Right.
    Because you don't really know whether they
  • 4:16 - 4:21
    are using TLS, encryption in any case. You
    don't know whether they upload it to
  • 4:21 - 4:27
    another antivirus vendor or so and then it
    gets uploaded to the IMAP folder to the
  • 4:27 - 4:32
    inbox of the receiver where it gets
    archived again, right? There is a backup
  • 4:32 - 4:38
    is being done and stuff like that, it's
    archived. And then finally the receiver of
  • 4:38 - 4:43
    the e-mail has the ability to check his
    own email and retrieve the e-mail
  • 4:43 - 4:49
    from his inbox. OK. So even if you know
    that the other person that you've just
  • 4:49 - 4:53
    sent the e-mail to does a good job in
    securing it and uses encryption everywhere
  • 4:53 - 4:56
    and so on and so on.
    You never know whether there's some
  • 4:56 - 5:02
    attacker or so who has compromised the
    infrastructure and so on and so on. OK.
  • 5:02 - 5:07
    And this problem multiplies.
    When you send an e-mail to multiple people
  • 5:07 - 5:11
    because then all of a sudden the e-mail
    that you just sent, your e-mail, hits
  • 5:11 - 5:17
    infrastructures of many other people. OK?
    So many people have access to this
  • 5:17 - 5:22
    e-mail and this is the first thing that I
    want to - this is the first point that I
  • 5:22 - 5:27
    want to make in this talk. People usually
    talk about their e-mail. It's my e-mail,
  • 5:27 - 5:32
    you know? And when I run my own mail server
    it's going to be secure but this is not
  • 5:32 - 5:37
    the case. I mean the the point of
    using e-mail is distributing it to your
  • 5:37 - 5:40
    friends to your colleagues and so on and
    so on because we want to exchange.
  • 5:40 - 5:43
    It's a communication method but the
    communication is archived so people
  • 5:43 - 5:52
    archive this and so on and so on. So it's
    it's a mess basically. OK. So for the rest
  • 5:52 - 5:56
    of this talk we need to have some
    assumption that someone has access to the
  • 5:56 - 6:02
    e-mails. OK. Because right. We just
    learned that it's distributed. You're
  • 6:02 - 6:06
    archiving your own e-mails in your IMAP
    folder and so on and so on I have the
  • 6:06 - 6:10
    e-mails of the last 15 years or so in my
    in my IMAP folder and if someone gets
  • 6:10 - 6:15
    access to it - right - boom. I have a
    problem. Okay. And in order to cope with
  • 6:15 - 6:19
    this people came up with end-to-end
    encryption. And there's two competing
  • 6:19 - 6:28
    standards out there. The first one is
    OpenPGP. It was first defined in 1991 from
  • 6:28 - 6:32
    Phil Zimmermann invited it. And this was
    like this happened in the first crypto
  • 6:32 - 6:39
    wars. So this is a very interesting story.
    And it's the most widely used e-mail
  • 6:39 - 6:43
    clients they they support OpenPGP but
    only when you when you download the
  • 6:43 - 6:49
    plug-in, OK? For S/MIME you usually
    have native support in most of the
  • 6:49 - 6:53
    applications so you just get an S/MIME
    certificate and off you go.
  • 6:53 - 6:57
    You can just use it and it just works out
    of the box but it's mostly used by
  • 6:57 - 7:02
    corporate organizations and military for
    example right. Not so much by privacy
  • 7:02 - 7:07
    advocates like OpenPGP.
    Now we can't measure very well how many
  • 7:07 - 7:11
    people use S/MIME. We tried but there
    doesn't seem to be a public source where
  • 7:11 - 7:16
    we can measure this but we can do it on
    PGP because PGP has key servers and you
  • 7:16 - 7:20
    can upload your key there so that people
    can communicate with you in a secure
  • 7:20 - 7:26
    manner. And this statistic here is the
    amount of new published public keys per
  • 7:26 - 7:33
    month. And it started off very low in
    1997. Then in 2003 we saw a constant rise
  • 7:33 - 7:40
    until 2013 where we see a a spike here
    where it more than doubled. Does anyone
  • 7:40 - 7:43
    know why we saw this spike in 2013?
    Someone in the audience: Snowden!
  • 7:43 - 7:49
    Sebastian: Snowden right. Edward Snowden
    we had the Snowden revelations and Edward
  • 7:49 - 7:54
    Snowden uses PGP to communicate with the
    journalists who did the actual, like,
  • 7:54 - 8:00
    disclosure of the documents. And so we see
    this in the uploader keys so people use
  • 8:00 - 8:06
    PGP much more. We also see this in
    the amount of daily users of Enigmail
  • 8:06 - 8:11
    which is the plugin for Thunderbird.
    And you can extract this
  • 8:11 - 8:16
    information and there we also see around
    2013 we see a jump and it increased by 50
  • 8:16 - 8:21
    percent or so something like this. So
    people use PGP, right? It's not that many
  • 8:21 - 8:25
    when you compare it to how many people use
    e-mail a few hundred thousand is not that
  • 8:25 - 8:32
    much but still it's a substantial number.
    The problem here is we know for a fact
  • 8:32 - 8:38
    that in the last 20 years or so especially
    non-technical users are not able to use
  • 8:38 - 8:44
    PGP in a secure manner. Okay. So we have
    the first paper from '99: "Why Johnny
  • 8:44 - 8:49
    Can't encrypt" and then we have a follow
    up paper from 2006: "Why Johnny still
  • 8:49 - 8:55
    can't encrypt", OK? So OK. Must've
    been better I hope and then in 2015 we
  • 8:55 - 9:00
    have "why Johnny Still, Still can't
    encrypt". OK? so we have a long story
  • 9:00 - 9:06
    where people try to use PGP but failed,
    OK? And this is not something that is
  • 9:06 - 9:13
    inherent in an OpenPGP. We have the same
    papers for S/MIME where they said
  • 9:13 - 9:18
    novice users - and where they confronted
    novice users with with S/MIME and they
  • 9:18 - 9:23
    failed, basically. They weren't able to
    use it in a secure manner. Okay.
  • 9:23 - 9:29
    So therefore in order to enable people to
    use PGP, especially PGP and S/MIME in a
  • 9:29 - 9:34
    secure manner you have many tutorials out
    there. And this is a very interesting
  • 9:34 - 9:39
    tutorial because it's the original video
    that Edward Snowden recorded in order to
  • 9:39 - 9:44
    teach Glenn Greenwald how to use openPGP.
    It's still on Vimeo. The original video is
  • 9:44 - 9:49
    still there. And what is interesting there
    is he doesn't recommend a plugin for an
  • 9:49 - 9:55
    email client. He basically says just use
    web mail and use this PGP standalone
  • 9:55 - 10:00
    application type your message there click
    encrypt and copy and paste the ciphertext
  • 10:00 - 10:06
    into your web mail, OK? So there's no
    integration and others recommend for
  • 10:06 - 10:13
    example Enigmail or GPGtools. Enigmail is
    the plugin for Thunderbird and GPGtools is
  • 10:13 - 10:18
    the plug in for Apple mail, which
    means that most of them had HTML
  • 10:18 - 10:23
    switched on which is an interesting fact.
    OK. For something that we are going to
  • 10:23 - 10:29
    talk about later. So I thought about how
    can I do this talk. And this is how I came
  • 10:29 - 10:34
    up with the agenda. So we start off with
    some attacks that are very I find pretty
  • 10:34 - 10:37
    interesting. At least for an academic they
    are pretty interesting, and we slowly
  • 10:37 - 10:42
    degrade to pretty silly attacks and you
    decide for yourself whether you would fall
  • 10:42 - 10:48
    for it or not. I came to the conclusion
    that I would probably fall for them. OK,
  • 10:48 - 10:54
    I lied. So we start off with something
    that is even worse than silly. So what is
  • 10:54 - 10:58
    it what's the worst thing that can happen
    when you're sending an encrypted mail.
  • 10:58 - 11:01
    Audience: You send your private key.
  • 11:01 - 11:04
    Sebastian: if you send your private key
    there would be bad. What's even worse?
  • 11:04 - 11:06
    Audience: You forget to encrypt.
  • 11:06 - 11:12
    Sebastian: you send a plain text. Okay
    okay. So in 2014 there was a bug in
  • 11:12 - 11:16
    Enigmail which is documented in their bug
    tracker. So basically you compose an e-mail
  • 11:16 - 11:20
    you tell Enigmail to sign and encrypt
    it, and then you send it and it will be
  • 11:20 - 11:28
    sent in plain text. Okay. Oh okay. This is
    not good. In 2017 Outlook did it much better
  • 11:28 - 11:33
    because they did encrypt it but they
    packed the plain text along with the
  • 11:33 - 11:42
    ciphertext. (Audience: laughing) Okay. Bad.
    And then in 2018 you may remember this is
  • 11:42 - 11:48
    just a few months back or so Enigmail or
    pretty easy privacy. It's a plugin to
  • 11:48 - 11:53
    Enigmail, so a plugin to a plugin that's
    actually used for novice users. It gave
  • 11:53 - 11:57
    the feedback that the email that you're
    composing will be encrypted but it wasn't.
  • 11:57 - 12:05
    Okay. And the good news here is: the
    e-mail attacks don't apply here because,
  • 12:05 - 12:10
    OK, I mean, it's about I don't want to make
    fun of any developers. The point that I'm
  • 12:10 - 12:16
    trying to make here is that email is a
    plaintext protocol and it's always very
  • 12:16 - 12:22
    difficult to make a protocol that was made
    for plain text delivery - to make this
  • 12:22 - 12:26
    encrypted. When you have a plaintext
    fallback you're into trouble. Okay. And we
  • 12:26 - 12:34
    we saw the same basically with HTTP and
    HTTPS. OK. So HTTPS is like now secure but
  • 12:34 - 12:38
    they hit the same issues right and
    browsers and so they were falling back to
  • 12:38 - 12:43
    HTTP and so on and so on. So it's really
    really difficult. Now that we have this
  • 12:43 - 12:48
    out of the way. Okay. We tried to look at
    the interesting interesting box and before
  • 12:48 - 12:54
    we start I want to make a short
    introduction into how the cryptography in
  • 12:54 - 13:00
    S/MIME and PGP work. And I just make one
    introduction because both are the same
  • 13:00 - 13:03
    from the viewpoint of the attacks that I'm
    going to present. Okay. Both are very
  • 13:03 - 13:09
    similar actually. So we start off by
    writing a message, m, this is here we
  • 13:09 - 13:14
    generate a session key, s, that that's
    basically a random session key and we use
  • 13:14 - 13:20
    this session key to encrypt the message
    and make a cipher text, c, and we use AES
  • 13:20 - 13:26
    or triple DES for example any symmetric
    cipher will do here.
  • 13:26 - 13:32
    Then we use this session key that we just
    generated and encrypt this with a public
  • 13:32 - 13:37
    key of the recipient and we get a K and we
    pack this K into the message so everything
  • 13:37 - 13:43
    will be packed into a message and sent off
    to the receiver. The receiver then
  • 13:43 - 13:49
    obtains the encrypted email he starts
    extracting the ciphertext K and the
  • 13:49 - 13:56
    ciphertext C. From K he decrypts s which is
    the session key, right? And with s he can
  • 13:56 - 14:03
    decrypt the ciphertext C and retrieves m.
    And so both have the same message. Okay.
  • 14:03 - 14:07
    So it's basically a hybrid encryption you
    use symmetric encryption for the actual
  • 14:07 - 14:12
    encryption off the message and then
    asymmetric encryption to just encrypt this
  • 14:12 - 14:18
    session key. Now, if you attended my
    previous talks I talk a lot about
  • 14:18 - 14:24
    ciphertext malleability. So you make tiny
    changes to a cipher text and it will lead
  • 14:24 - 14:29
    to predictable changes in the plaintext
    which is strange, right? So we would
  • 14:29 - 14:34
    assume when we just flip a bit here
    somewhere, okay? Here's a bit that just
  • 14:34 - 14:37
    flipped and where we decrypted we get
    something like this. Usually you would
  • 14:37 - 14:43
    think OK. It's total garbage. Nothing
    sensible should come out of
  • 14:43 - 14:47
    this but we see something like this. Most
    of the message is still intact. We just
  • 14:47 - 14:55
    have a few randomly looking junk binary
    stuff in there and we see one changed
  • 14:55 - 15:00
    character here. That used to be "email"
    and now it's "efail". Okay so there was
  • 15:00 - 15:04
    just some bit flipping happening here. In
    order to understand this we need to
  • 15:04 - 15:09
    introduce something that we called a mode
    of operation. AES or any other block
  • 15:09 - 15:15
    cipher has the property that it uses
    blocks. In most cases it's 16 bytes.
  • 15:15 - 15:21
    And when you want to encrypt more than 16
    bytes you need to call AES multiple times
  • 15:21 - 15:25
    and you split it into blocks and CBC is
    one way of connecting these ciphertext
  • 15:25 - 15:31
    blocks so the decryption works like this.
    You have the first ciphertext block the
  • 15:31 - 15:37
    second ciphertext block and the third
    ciphertext block. Only the second one is
  • 15:37 - 15:43
    decrypted so C1 is decrypted using AES and
    your key for example. And the result here
  • 15:43 - 15:50
    is not directly the plaintext but it will
    be XORed with C0 which will we would also
  • 15:50 - 15:55
    call an initialization vector. Okay so
    whatever is written in here will be XORed
  • 15:55 - 16:01
    on whatever comes out of this description
    and we get this plaintext here. Now when
  • 16:01 - 16:07
    we flip a bit or when we change a certain
    byte in C0 we change whatever comes out
  • 16:07 - 16:12
    here of the decryption and we will
    flip the same bit at the same position in
  • 16:12 - 16:19
    the plaintext which is interesting because
    now when we say we use the original c0 and
  • 16:19 - 16:27
    XOR it with p0. So when we XOR it when we
    XOR two times the same value we get
  • 16:27 - 16:34
    basically a block of all zeros which is
    like a blank sheet of paper that we can
  • 16:34 - 16:39
    write on and we call this thing - these two
    blocks here in combination - we call this a
  • 16:39 - 16:45
    CBC gadget because we can reuse it as as
    much as we want. And when we now take a
  • 16:45 - 16:51
    chosen ciphertext the nice thing is here
    we just XOR it - the chosen ciphertext on
  • 16:51 - 16:56
    this initialization vector and it means
    that it will here result in a chosen
  • 16:56 - 17:01
    ciphertext.
    So this requires that we know the value of
  • 17:01 - 17:07
    p0. We need to guess this value of p0. And
    this is always true at least for S/MIME
  • 17:07 - 17:12
    because all S/MIME emails start with a
    content type so we always know the first
  • 17:12 - 17:19
    bytes. So this is valid. We can do this
    now. This was like the perfect
  • 17:19 - 17:24
    scenario. It does have some drawbacks
    because when we tried to do the same for
  • 17:24 - 17:30
    C1 we switch, we flip, a bit here then we
    flip a bit also here. But the decryption
  • 17:30 - 17:35
    of C1 results in this random junk and we
    can't do anything about it. We don't know
  • 17:35 - 17:40
    whatever will come out here and we can't
    control it. Okay we just have to deal with
  • 17:40 - 17:44
    it. It's gonna be there when we use the
    CBC gadgets and we have to deal with it.
  • 17:44 - 17:49
    We have to find a way to deal with it and
    now we can explain this behavior, you know?
  • 17:49 - 17:54
    You remember this e-mail where we just
    flipped a single bit and we saw one block
  • 17:54 - 17:59
    was destroyed basically. And then the
    other block we had like we can flip
  • 17:59 - 18:04
    arbitrary bits. That's the explanation
    for it. Now how do you how do
  • 18:04 - 18:09
    you deal with it. How should a proper
    crypto protocol deal with it. Usually you
  • 18:09 - 18:13
    do something that is called a message
    authentication code. It's not a digital
  • 18:13 - 18:19
    signature and message authentication code
    is something like a checksum a
  • 18:19 - 18:24
    cryptographic checksum that is
    put right next to the
  • 18:24 - 18:28
    encrypted message and that can be
    checked after decryption or for
  • 18:28 - 18:31
    decryption. OK? The message
    authentication code is solely there to
  • 18:31 - 18:36
    detect changes of a ciphertext. Digital
    signatures are different especially in the
  • 18:36 - 18:41
    mail context because they're pretty
    much totally separate from
  • 18:41 - 18:47
    the decryption part. So digital signatures
    are merely only used to display an icon
  • 18:47 - 18:56
    for example for valid signature or invalid
    signature. And the problem here is a smart
  • 18:56 - 19:01
    attacker can use a signed email and strip
    off the signature. Okay. We just strip off
  • 19:01 - 19:06
    this part that we know there's a signature
    we can remove the signature and then this
  • 19:06 - 19:10
    doesn't mean there will be an invalid
    signature but will get something like
  • 19:10 - 19:16
    this. This is the icon in thunderbird for
    encrypted and not signed so we can simply
  • 19:16 - 19:22
    strip off a signature and there's valid
    reasons to send an encrypted email without
  • 19:22 - 19:28
    doing a digital signature on it, right? So
    we want to do both. So digital
  • 19:28 - 19:34
    signatures won't prevent this
    attack. So how does S/MIME look like?
  • 19:34 - 19:39
    Basically, I mean, most of you will have
    heard of MIME. MIME is like a standard
  • 19:39 - 19:45
    that we use in emails anyway. Here
    we have an e-mail header. It looks very
  • 19:45 - 19:51
    similar to HTTP. We have content type,
    colon, empty space, and then it's
  • 19:51 - 19:57
    whatever is coming now for data. And then
    we have an e-mail body with envelope data
  • 19:57 - 20:01
    and there we have the list of the of the
    encrypted session keys that this
  • 20:01 - 20:08
    ciphertext was encrypted with. And after
    that we have the encrypted content info
  • 20:08 - 20:13
    here. This part is the encrypted part
    where the actual message where the actual
  • 20:13 - 20:17
    message lies. And now when you look
    closely and you squint you see there's no
  • 20:17 - 20:23
    message authentication code and it's not
    because I left them out but because S/MIME
  • 20:23 - 20:27
    doesn't define one. So S/MIME doesn't have
    a message authentication code which
  • 20:27 - 20:33
    means it cannot detect bye the standard
    whether a message was changed - whether
  • 20:33 - 20:37
    it was changed or not.
    So how can we attack this?
  • 20:37 - 20:42
    How can we use it? I think you all have a
    feeling that this shouldn't work, OK? This
  • 20:42 - 20:47
    is nothing that is supposed to work.
    This is the plain text that we want to
  • 20:47 - 20:51
    exfiltrate and we only know the first
    block. We can pretty much always guess the
  • 20:51 - 20:56
    first block because it's always content
    type: text/html or text/plain something
  • 20:56 - 21:04
    like this. Now we can use this as a gadget
    here and write our arbitrary plain text.
  • 21:04 - 21:08
    We have a random block and then chosen
    plain text. Then we copy it again. We
  • 21:08 - 21:13
    again have a random block and some chosen
    plain text. Then we have a random block
  • 21:13 - 21:17
    and a chosen plain text. Then we have a
    random block and a chosen plain text. Then
  • 21:17 - 21:24
    we copy here the original ciphertext and
    we close this thing. And when you look
  • 21:24 - 21:28
    closely again you'll see that we're
    building HTML here right. That's the base
  • 21:28 - 21:34
    tag. That's an image tag. It uses a URL.
    That is not closed here. It will be closed
  • 21:34 - 21:40
    down here. And this is effectively the
    URL. OK. A URL-path and will thus be
  • 21:40 - 21:45
    exfiltrated. So when this XML is
    interpreted the actual plain text is sent
  • 21:45 - 21:52
    to the server. And here we have an old
    Thunderbird. So that is a version of
  • 21:52 - 21:58
    before May and before we did the
    disclosure. We first compose a message
  • 21:58 - 22:03
    just to have some PGP ciphertext. This is
    a very secret message. And here we have
  • 22:03 - 22:10
    the attack e-mail that is already
    prepared. And now it asks us
  • 22:10 - 22:14
    "This remote content in here. What do you
    want to do?" And we just for the
  • 22:14 - 22:19
    laughs just - like this - we just click it
    and we see always now when we select the
  • 22:19 - 22:27
    message an HTTP request is done to this
    to this URL. And when we decode this - it
  • 22:27 - 22:32
    looks pretty - it's encoded. But basically
    what we have here now you see here is the
  • 22:32 - 22:37
    secret message and here is random junk.
    And here again is random junk, right? So
  • 22:37 - 22:43
    it was successfully exfiltrated. This was
    the first proof of concept that we had.
  • 22:43 - 22:51
    Right? And. Okay right? And so this works.
    This is like - this
  • 22:51 - 22:55
    dialog here that you get in Thunderbird
    that ask if should I should a load remote
  • 22:55 - 23:00
    images. Yes or no. This is basically
    everything that is keeping you from losing
  • 23:00 - 23:06
    your your PGP or S/MIME ciphertext - S/MIME
    we're talking about S/MIME here. Now what we
  • 23:06 - 23:12
    did next was we were asking ourselves, OK:
    It works with remote images. We understand
  • 23:12 - 23:16
    this ,but what other back channels do we
    have? Back channel is something where
  • 23:16 - 23:21
    your email client is communicating
    over the network. That's. So it's not
  • 23:21 - 23:26
    necessarily exfiltrating but it's just
    like how can we convince a client to make
  • 23:26 - 23:33
    a connection to somewhere else. Now I
    colored in red all the e-mail clients that
  • 23:33 - 23:38
    require user interaction - that always
    require user interaction before it
  • 23:38 - 23:45
    opens up a network connection somewhere.
    In orange we say that there's no user
  • 23:45 - 23:50
    interaction. So these are the clients that
    allow for example loading remote images by
  • 23:50 - 23:54
    default. OK. There's mail app for example
    there's gmail for example. They will not
  • 23:54 - 24:00
    ask you they will just load it, OK? And
    but what we think is worse and therefore
  • 24:00 - 24:06
    we colored it red are the clients that say
    we won't load remote images or any other
  • 24:06 - 24:12
    way of communicating over the network. But
    then they will because we want bypasses.
  • 24:12 - 24:17
    So because preventing loading remote
    images is basically a firewall and we
  • 24:17 - 24:23
    bypass this local firewall and found
    several ways of extracting it. And there's
  • 24:23 - 24:28
    even four or five of them that even allow
    JavaScript execution in a mail
  • 24:28 - 24:33
    client. I mean come on this is really
    weird. So basically 40 of 47 clients have
  • 24:33 - 24:37
    back channels that require no user
    interaction at all. And now we went out
  • 24:37 - 24:43
    and tried to think about how can we
    exfiltrate plain text over it. And this
  • 24:43 - 24:49
    is the final table the final result
    table for S/MIME and it looks pretty
  • 24:49 - 24:54
    grim, right? So the red ones means it's
    vulnerable. That means we could exfiltrate
  • 24:54 - 25:00
    plain text successfully. The ones with a
    dash they don't support S/MIME and Claws
  • 25:00 - 25:04
    and Mutt we just didn't find any
    remote connection there.
  • 25:04 - 25:08
    Okay. Which is good. Which is good. Yeah.
    That's a round of applause. Right.
  • 25:08 - 25:13
    applause
  • 25:13 - 25:18
    So I didn't say what S in S/MIME means.
    It actually means super. So it's super
  • 25:18 - 25:23
    MIME. I don't know. Is it Super MIME? And
    basically his kryptonite. You know the the
  • 25:23 - 25:29
    super villan of Super MIME is HTML. Right.
    You could say this. So S/MIME is broken
  • 25:29 - 25:34
    by HTML and it's a very annoying
    kryptonite because it jumps you
  • 25:34 - 25:42
    know like it's ugly colors. Now this is my
    Thunderbird that I have on my Mac at home.
  • 25:42 - 25:46
    So this is like something that I recorded
    two days ago or so. And here I want to try
  • 25:46 - 25:53
    to show you a way of exfiltrading the data
    without using HTML. So HTML here is
  • 25:53 - 25:59
    disabled. This is the message that we want
    to break. And here we see the same message
  • 25:59 - 26:04
    where we just changed, using
    gadgeting, we just changed the URL.
  • 26:04 - 26:10
    So in Thunderbird when you disable HTML
    it will still highlight the links and when
  • 26:10 - 26:17
    you click on it you're gonna exfiltrate
    plain text, right. So we require a little
  • 26:17 - 26:24
    bit of user interaction but we can
    basically change a S/MIME ciphertext in a
  • 26:24 - 26:28
    way that it will contain links and when
    you click a single link you will lose your
  • 26:28 - 26:34
    your plain text. It's just a single click
    on it and the thing here is - I mean this
  • 26:34 - 26:38
    is not a zero day in e-mail client, right?
    You just can't do anything about it.
  • 26:38 - 26:46
    That's the problem. Okay. So people said
    okay so efail - just disable HTML and then
  • 26:46 - 26:52
    you'll be fine. But the problem here is
    basically efail should work with any
  • 26:52 - 26:57
    format that supports external connections.
    So as soon as you have a file format for
  • 26:57 - 27:02
    example that supports external connections
    like PDF here, right? This is a PDF. When
  • 27:02 - 27:06
    you click on it it will warn you and will
    say "Do you really want to make a
  • 27:06 - 27:12
    connection to this domain?" And if you
    click "yes" you will do a connection there,
  • 27:12 - 27:18
    right? And when you look at the how
    the URL is encoded in the PDF when you
  • 27:18 - 27:23
    open the PDF in an hex editor you see it's
    just a string just like HTML,
  • 27:23 - 27:28
    basically, right? So we could in theory
    use this as well. So you could change and
  • 27:28 - 27:32
    S/MIME e-mail that it contains a PDF
    attachment and when you click the PDF
  • 27:32 - 27:37
    attachment it will exfiltrate. With no
    user interaction, it works with with
  • 27:37 - 27:43
    Microsoft Word for example. So that's a
    doc file and doc files allow external
  • 27:43 - 27:51
    images that will load. It has no user
    interaction at all, so you just open it and
  • 27:51 - 27:55
    the request will happen and the only
    problem that we're having here is it's not
  • 27:55 - 28:00
    an ASCII URL, it's a Unicode URL. So I'm
    not sure whether this works with
  • 28:00 - 28:06
    exfiltration but hey no user interaction,
    right? And. Now you could say "Okay PDF,
  • 28:06 - 28:10
    Microsoft Word. That's very bad." - The same
    works in in LibreOffice and it's not a
  • 28:10 - 28:20
    bug in the viewers, right? It's a basic
    feature that has been in these standards
  • 28:20 - 28:23
    forever, right? So it's a thing that will
    be supported. It's not a zero day
  • 28:23 - 28:28
    vulnerability in these viewers. It's just
    the file format support it, so you can
  • 28:28 - 28:34
    abuse it. If you have some time: here's a
    challenge for you. If someone is able to
  • 28:34 - 28:43
    make a successful demo for exfiltrating an
    S/MIME e-mail using a PDF or a doc file for
  • 28:43 - 28:49
    example you will get a crate of Club Mate
    and some efail swag, if you want to?
  • 28:49 - 28:56
    OK. So what happened after we disclosed
    it. Obviously we disclosed it to all the
  • 28:56 - 29:01
    manufacturers and so on. And there's an
    S/MIME draft of a new RFC. So there's a
  • 29:01 - 29:05
    working group and they already
    massaged the countermeasures into the
  • 29:05 - 29:11
    current RFC draft. So for example to
    counter the CBC gadget attack they say: use
  • 29:11 - 29:20
    a GCM which is not right now in the in the
    current RFC but in a draft it's already in.
  • 29:20 - 29:22
    And so they're referencing
    the paper and they're saying:
  • 29:22 - 29:27
    "OK you need to do this and do this as
    quickly as possible." And the second Efail
  • 29:27 - 29:33
    attack which I'll talk about very soon is
    also mitigated in this in this RFC draft.
  • 29:33 - 29:39
    OK. So S/MIME was pretty much broken. And
    you can just try to convince your e-mail
  • 29:39 - 29:46
    client not to do any external connections.
    OK. That's all you have. Which at least,
  • 29:46 - 29:52
    I mean, for cryptographer this means
    broken, OK? When you have to rely
  • 29:52 - 29:56
    on the viewer not making any connections,
    the cryptography is broken. So what are
  • 29:56 - 30:02
    the changes to OpenPGP because there are
    substantial differences to to OpenPGP.
  • 30:02 - 30:09
    So first of all PGP uses a variation of the
    CFB-mode. It's not CBC-mode but CFB-mode.
  • 30:09 - 30:15
    And they have pretty similar, they are
    very similar. So I won't show it here,
  • 30:15 - 30:20
    if you are looking for the details, please
    look at the paper, but it's very similar.
  • 30:20 - 30:25
    We can also flip bits and we also have
    these chunk bits in the middle and so on.
  • 30:25 - 30:30
    What really caused a lot of headaches is
    the plain text compression. So that means
  • 30:30 - 30:38
    in OpenPGP you don't encrypt directly the
    plain text but you deflate it
  • 30:38 - 30:42
    before you encrypt it and that makes it
    very hard to guess plain text bytes, because
  • 30:42 - 30:47
    for our attack to work we need to guess plain
    text bytes and when we know plain text
  • 30:47 - 30:53
    certain parts of the plain text but it's
    deflated we have a problem. Okay? And what
  • 30:53 - 30:58
    is also the most important thing is that
    OpenPGP defines a modification
  • 30:58 - 31:02
    detection code, which is basically this is
    the message here. And the modification
  • 31:02 - 31:08
    detection code is a hash of the message
    appended at the plain text and
  • 31:08 - 31:18
    then encrypted. Okay? Which should detect
    plain text modifications. Now
  • 31:18 - 31:25
    how does the OpenPGP standard say how to
    deal with broken MDCs when an MDC is not
  • 31:25 - 31:29
    valid. Well, they say an implementation
    must treat an MDC failure as a security
  • 31:29 - 31:34
    problem, but they don't say what is a
    security problem. What do you need to do
  • 31:34 - 31:40
    then. And the implementation may allow the
    user access to the erroneous data. So the
  • 31:40 - 31:44
    modified data may be passed on to the
    e-mail clients.
  • 31:44 - 31:50
    And basically we tried to do this, right?
    But before we go there we looked at how
  • 31:50 - 31:54
    many keys on the public key servers
    support MDCs at all.
  • 31:54 - 32:01
    So MDC is a feature that came to OpenPGP
    in the early 2000s and before that it
  • 32:01 - 32:05
    wasn't possible to use it. And so
    therefore to make this to make the change
  • 32:05 - 32:12
    from software that doesn't use MDC versus
    software that that does use MDC they
  • 32:12 - 32:18
    encoded in the key whether you support MDC
    or not. And here you see those keys that
  • 32:18 - 32:22
    were generated in 2000 they don't support
    MDCs and the green ones - they support
  • 32:22 - 32:31
    it. But, the problem is, when you accumulate
    all the valid keys in PGP that don't
  • 32:31 - 32:37
    support MDCs we still see that at the key
    servers right now in 2017 we have
  • 32:37 - 32:42
    something like one point seven million of
    the keys that don't support MDC. So when I
  • 32:42 - 32:49
    sent an email to one of these people my
    implementation will not use an MDC, or
  • 32:49 - 32:55
    right? They - yeah I'll come to this later.
    So we thought about okay how
  • 32:55 - 33:00
    can we make a structured analysis how the
    MDC is treated with. The OpenPGP standard
  • 33:00 - 33:05
    is not clear what to do with it. And so
    we have three test cases. First of all, we
  • 33:05 - 33:11
    try to strip the MDC. So we just use this
    encrypted packet here and strip off at the
  • 33:11 - 33:17
    end. We just say OK it's incorrect, right?
    So we make our modification in the
  • 33:17 - 33:24
    plain text and see whether they will detect
    this error or we could also do this
  • 33:24 - 33:29
    downgrade from the packet type that
    supports MDC to the old packet type that
  • 33:29 - 33:35
    does not support MDC, right? And when we
    check this, especially with the most widely
  • 33:35 - 33:40
    used clients we saw that Thunderbird and
    Enigmail and Apple Mail and GPG tools they
  • 33:40 - 33:46
    basically ignored the MDC and that was the
    reason why we didn't see the MDC as very
  • 33:46 - 33:52
    important because in our test systems it
    wasn't just treated, OK?
  • 33:52 - 33:58
    Now what are the Efail related changes
    to OpenPGP. And we're talking about the
  • 33:58 - 34:03
    changes that were done after we
    disclosed this to them.
  • 34:03 - 34:06
    First of all they made something that is
    very important.
  • 34:06 - 34:11
    They say that the packet type and PGP that
    does not support MDC is now obsolete. So
  • 34:11 - 34:16
    you must not use this packet type anymore.
    You must ignore it. Which also means that
  • 34:16 - 34:22
    when you have used non MDC messages in
    your mailbox you will not be able to open
  • 34:22 - 34:28
    them anymore, OK? Yeah. That's a
    problem. Then they also said: "OK, what
  • 34:28 - 34:34
    is supposed to happen when the MDC
    was wrong?" And this is the text that we
  • 34:34 - 34:38
    have already seen where we said "the
    implementation may allow the user access
  • 34:38 - 34:43
    to the erroneous data" and they changed
    this in the current draft to "the
  • 34:43 - 34:48
    implementation should not allow the user
    to process the erroneous data." Right? They
  • 34:48 - 34:53
    must still warn the user. And so on and so
    on. But it should not allow the user, which
  • 34:53 - 35:02
    is good. That's a good change. So this was
    the - this MDC check is a bit troublesome
  • 35:02 - 35:08
    because it's right at the end of the
    plain text, so you can only check the MDC
  • 35:08 - 35:13
    when you have fully decrypted the message
    which means when you have a large e-mail
  • 35:13 - 35:19
    or a large back-up or so you have to fully
    decrypt it and afterwards only you can tell
  • 35:19 - 35:24
    whether it was valid or not. And the
    solution of GnuPG is that it will just
  • 35:24 - 35:31
    stream - while it decrypts it will stream
    the data to to the e-mail client and
  • 35:31 - 35:35
    afterwards tell it whether it's supposed
    to use it or not, OK? So here's your
  • 35:35 - 35:40
    email, here's your e-mail, here's your - Oh no!
    You must not use it, please forget it, right?
  • 35:40 - 35:45
    Which is not fine. This is not a safe way of
    doing it. So the current OpenPGP draft,
  • 35:45 - 35:49
    before Efail, before we did the
    disclosure already supported something
  • 35:49 - 35:54
    that they called chunking. So they not
    only have an MDC some kind of a MAC at the
  • 35:54 - 35:58
    end of the plain text, but they chunk it
    into more chunks and each of these
  • 35:58 - 36:05
    has a MAC - a real MAC - which is much better
    because, right? You can authenticate chunks
  • 36:05 - 36:14
    and cache it before you give it to the
    app. The problem is that the standard says
  • 36:14 - 36:21
    that 120MB is like a good chunk size
    which is far too big, right? Far too big.
  • 36:21 - 36:26
    And when we look at the Efail related
    changes to GnuPG. So for example MDCs
  • 36:26 - 36:32
    where they used to be warnings. So when
    GnuPG was detecting that an MDC is not
  • 36:32 - 36:38
    there or it's wrong, they would just warn
    it but it would still print it out. GnuPG
  • 36:38 - 36:45
    now, like, fails it makes a hard failure now
    and GnuPG now always uses the MDC
  • 36:45 - 36:51
    independently if the key denotes that
    the receiver can use it or not. Which
  • 36:51 - 36:55
    is also very good but it is a breaking
    change, rightß So when you have people that
  • 36:55 - 36:58
    send you PGP e-mails and you can't decrypt
    them anymore you have to tell them that
  • 36:58 - 37:06
    they need to update GnuPG.
    They also say that the default chunk size
  • 37:06 - 37:12
    is 120 megabyte which means they still
    stream unauthenticated plaintext so they
  • 37:12 - 37:18
    missed this opportunity to make
    this go away, which is a pity.
  • 37:18 - 37:24
    Okay. What is not answered neither by
    S/MIME nor by PGP: How to deal with past
  • 37:24 - 37:28
    e-mails? So, basically all the emails that
    you're sending in S/MIME encrypted right
  • 37:28 - 37:35
    now are insecure and the old ones that
    don't use MDC in PGP they are also not
  • 37:35 - 37:39
    secure and nobody talks about what's
    supposed to happen with them, right?
  • 37:39 - 37:44
    Okay, that was the interesting attack. That
  • 37:44 - 37:47
    was the one that was really
    cryptographically involving,
  • 37:47 - 37:51
    that required changes to the standards and
    so on. Now let's look at something that's
  • 37:51 - 37:57
    a bit more silly. Okay, so we have Alice
    writes an e-mail to Bob, we encrypt it and
  • 37:57 - 38:03
    send it off to Bob. Now here we have the
    original e-mail and now Eve composes an
  • 38:03 - 38:09
    attack e-mail. And it somehow gained access
    to the PGP ciphertext, it also works for
  • 38:09 - 38:13
    S/MIME, right, it's independent. It's a
    vulnerability in the in the mail clients.
  • 38:13 - 38:18
    And now we don't change the ciphertext we
    just surround it with other MIME parts
  • 38:18 - 38:24
    that are of type HTML and that exfiltrated
    the same as we did before only that we
  • 38:24 - 38:29
    don't need to change the
    ciphertext at all, right?
  • 38:29 - 38:34
    So basically when this is decrypted it
    will be replaced with a plain text in
  • 38:34 - 38:39
    place and then it will be merged into one
    document. And now I have to tell you
  • 38:39 - 38:45
    something that many people don't seem to
    know. All mail clients, except mutt, they
  • 38:45 - 38:52
    use HTML to view emails. So even when you
    disable HTML it basically means that they
  • 38:52 - 38:58
    will use incoming HTML e-mails, parse
    them, transform them into something that
  • 38:58 - 39:04
    looks like ASCII and display this in HTML.
    Okay. So, right? There is no such thing as
  • 39:04 - 39:10
    ASCII e-mails with most of the clients. So
    but here now you have one HTML document
  • 39:10 - 39:16
    which basically means the same, it will
    exfiltrate and very easy. Okay? So let's
  • 39:16 - 39:22
    look here and on this video here we have
    we create one ciphertext we encrypt it. We
  • 39:22 - 39:29
    use Apple Mail because this was one of the
    two vulnerable clients and we just open this
  • 39:29 - 39:37
    email in order to view the PGP ciphertext,
    right? We look at the raw code of the
  • 39:37 - 39:45
    ciphertext, raw source and we scroll down
    and there we see there's the PGP message,
  • 39:45 - 39:53
    OK? Now in the next minute Eve somehow
    gained access to this ciphertext and it
  • 39:53 - 40:01
    will compose a attacker email which is
    hidden in a python program that we just
  • 40:01 - 40:06
    use to generate an e-mail, so this
    happened now in the background, you will
  • 40:06 - 40:14
    see an e-mail is incoming. Here we
    just open the access log for this and when
  • 40:14 - 40:21
    we click on it, right at this time, it will
    be exfiltrated. Okay. So very easy attack,
  • 40:21 - 40:25
    anyone can do this, you don't need to know
    anything about cryptography you only need
  • 40:25 - 40:29
    to understand a little bit of HTML and a
    little bit of MIME and you can execute
  • 40:29 - 40:37
    this. You know what's worse than this? How
    about we just exfiltrate many e-mails with
  • 40:37 - 40:42
    a single attack e-mail because we could
    basically use - here we open an image,
  • 40:42 - 40:47
    here's the ciphertext. Here would close
    it. Then we open another image. Here's the
  • 40:47 - 40:52
    second ciphertext. Then we close it. Then
    we open a third one and so on and so on.
  • 40:52 - 40:57
    And what you see here, on the left hand
    side you see there's 100 ciphertext packed
  • 40:57 - 41:03
    into one e-mail that is sent to this
    client. I blurred this because I used 100
  • 41:03 - 41:09
    GPG e-mails that I sent, right? I didn't
    want to show them to you. Now this takes
  • 41:09 - 41:13
    some time. Now it's like decrypting,
    decrypting, decrypting, decrypting. And when
  • 41:13 - 41:18
    you look at the terminal on the left side
    you see 100 e-mails getting exfiltated,
  • 41:18 - 41:24
    right? Automatically simply by opening a
    single email. Okay this is horrifying.
  • 41:24 - 41:31
    Applause
  • 41:31 - 41:35
    And when I say horrifying I'm really
    literally mean: this is horrifying. So we
  • 41:35 - 41:40
    were like afraid OK when we disclose this
    then people will start attacking this
  • 41:40 - 41:48
    within the hour or so, OK? And so we
    disclosed this in early 2018. End of 2017,
  • 41:48 - 41:57
    early 2018. And in May 2018 we had already
    shifted the disclosure date twice and in
  • 41:57 - 42:02
    May we said OK we won't shift this
    anymore. And so therefore we said OK we go
  • 42:02 - 42:06
    online but we want to make a
    preannouncement. We want to
  • 42:06 - 42:12
    warn the people that if you use
    PGP or S/MIME for very sensitive
  • 42:12 - 42:17
    communication you should disable it in
    your e-mail client for now. These are the
  • 42:17 - 42:23
    original tweets that we sent and we said:
    OK, In a day, OK, when you have done this
  • 42:23 - 42:27
    then we will disclose everything, OK? We
    will go online with the paper and
  • 42:27 - 42:33
    everything. And now I mean people started
    talking about it and then the GnuPG people
  • 42:33 - 42:38
    started tweeting and they basically broke
    the embargo. So they told OK the attack is
  • 42:38 - 42:41
    working like this. First you do this and
    then you do that and then you do that and
  • 42:41 - 42:45
    they were blabbing and so on and then they
    sent it, which is annoying, but then they
  • 42:45 - 42:50
    sent this. So they said know that new
    GnuPG team was not contacted by them in
  • 42:50 - 42:56
    advance. And this, this really, OK? Then
    it got really hot. Okay.
  • 42:56 - 43:00
    This is not true. I will show you later,
    but I mean this tipped off almost anyone
  • 43:00 - 43:06
    in the INFOSEC community. And we got hate
    e-mails and yeah people were really mad
  • 43:06 - 43:10
    with them, I posted "We did contact them."
    and this is like the, these are the
  • 43:10 - 43:14
    original dates when I talked with Werner
    Koch which is the main developer of of
  • 43:14 - 43:18
    GnuPG. But it was too late. I mean they
    they recognized that they said: "Oh yeah, oh
  • 43:18 - 43:25
    I forgot!" Right? That they sent this paper
    here. That writes EFAIL with our names and
  • 43:25 - 43:31
    a date and an embargo and so on and so on.
    And they said they forgot it, OK? But I
  • 43:31 - 43:37
    mean we lost at this point, OK? People
    were hating us. I was called a murderer.
  • 43:37 - 43:41
    And and so on and so on and so it was
    really, really weird. If you're interested
  • 43:41 - 43:45
    of how things worked, right, this is an
    independent summary of the disclosure
  • 43:45 - 43:51
    timeline from Thomas Ptacek which is not
    involved with us at all we have never met
  • 43:51 - 43:55
    him, but who was so kind to just compile
    this just from public information that are
  • 43:55 - 44:02
    really reliable.
    So and then something happened that
  • 44:02 - 44:07
    we what we could foresee. People were
    finding - like there were some patches -
  • 44:07 - 44:12
    and I told you already that we saw
    that these patches are not sufficient.
  • 44:12 - 44:19
    And two days later people came up with new
    style of attacks, new EFAIL attacks and
  • 44:19 - 44:23
    this was Hanno who found something. So he
    said I found a trivial bypass EFAIL is
  • 44:23 - 44:28
    still exploitable with the latest Enigmail
    and Thunderbird - that is three days after
  • 44:28 - 44:32
    we did the disclosure and he responsibly
    disclosed this and so on and so on. So
  • 44:32 - 44:37
    everything is fine. Micah Lee, from The
    Intercept, also developed a proof of
  • 44:37 - 44:43
    concept exploit that works against Apple
    Mail and GPG tools also 2 or 3 days later.
  • 44:43 - 44:48
    So we were right, right? So people were
    finding ways to circumvent the fixes that
  • 44:48 - 44:55
    were in there. But still I mean, OK, media
    was blowing up, OK? And we didn't actually
  • 44:55 - 45:02
    understand what was really going on there.
    But you have to know I mean PGP is like,
  • 45:02 - 45:07
    one of the main users of PHP, eh of PGP is
    journalists, right.
  • 45:07 - 45:11
    So and they basically, I mean you show
    it to them look that's the attack and they
  • 45:11 - 45:17
    will like what? That's how easy it is? And
    that's what you see in the press I guess.
  • 45:17 - 45:23
    So what are the lessons learned from the
    disclosure. So first of all: people kept
  • 45:23 - 45:27
    complaining, I mean people kept
    complaining to us that we didn't stick to
  • 45:27 - 45:32
    the 90 day disclosure deadline. So
    we had more than 200 days disclosure and
  • 45:32 - 45:36
    we postponed it and so on and so on. And
    in the aftermath it didn't make sense
  • 45:36 - 45:41
    because we were postponing and postponing
    it and there were still no reliable fixes.
  • 45:41 - 45:44
    So we should have stuck to the 90 day
    disclosure deadline because after we
  • 45:44 - 45:48
    disclosed it they were in a rush. They
    released patches and stuff like, you know?
  • 45:48 - 45:54
    So it was, yeah. Be careful with
    disclosure preannouncements. The problem
  • 45:54 - 46:01
    here is people will speculate about the
    details. You know, because when you say: "OK
  • 46:01 - 46:05
    we'll disclose something tomorrow but
    we're not going to speak today" - then
  • 46:05 - 46:09
    journalists will speak to some random
    people, right? That they just get their
  • 46:09 - 46:14
    hands on and they will just try to guess
    what it could be. And this means they will
  • 46:14 - 46:20
    underrate the risk or they will overrate
    the risk. Underrate the risk is just
  • 46:20 - 46:24
    disable external images, loading external
    images, then you're fine. That is
  • 46:24 - 46:30
    underrating and overrating is like: "OK, PGP
    is broken, forever", right? Which is not
  • 46:30 - 46:35
    the case. And they will spread this false
    information and you still see this out
  • 46:35 - 46:41
    there, right? It's documented. People have
    issued like papers and so on and so on
  • 46:41 - 46:45
    with wrong information, provably wrong
    information. Which is bad and so these
  • 46:45 - 46:48
    disclosure preannouncements are bad
    because you're not in control of the
  • 46:48 - 46:53
    communication anymore. That's very bad.
    And controlling information flow really is
  • 46:53 - 46:57
    key after you do the disclosure because
    otherwise you get the wrong story out and
  • 46:57 - 47:06
    this this doesn't help at all. Okay. Let's
    look at the last attack, and we call this
  • 47:06 - 47:10
    reply to attacker.
    And I have to give credit to the people of
  • 47:10 - 47:17
    Cure53, which also found this bug or a
    similar very similar version of this bug
  • 47:17 - 47:21
    as well and disclosed it. But they were
    first to disclose it so credit goes to
  • 47:21 - 47:27
    them, OK? Here, the attacker scenario is
    I get an e-mail from some person which
  • 47:27 - 47:32
    makes sense. It's a benign e-mail. Okay.
    It doesn't look bad at all. And a person
  • 47:32 - 47:37
    wants to trick me to answer this e-mail.
    So this is the e-mail that I get. There's
  • 47:37 - 47:43
    some footer here and stuff like that. And
    now we look in the video, it's an old
  • 47:43 - 47:51
    version of Mail that we use here. Right.
    This is the e-mail. We just - and I answer
  • 47:51 - 47:55
    it, right? Because people were asking
    me for an appointment they want to
  • 47:55 - 47:59
    meet me and I was like yeah sure after my
    talk let's just meet. And this is the
  • 47:59 - 48:05
    attacker e-mail that the attackers opened
    and when you look closely down here you'll
  • 48:05 - 48:11
    see secret stuff here that shouldn't be in
    there and that I didn't send actually.
  • 48:11 - 48:17
    Let's look at the plain text of this
    e-mail and the source code of this e-mail.
  • 48:17 - 48:24
    And when you scroll down you see it's a
    mix of just a normal, just a normal
  • 48:24 - 48:28
    e-mail, benign e-mail. And down here you
    find a ciphertext it can be S/MIME it can
  • 48:28 - 48:35
    be PGP. It doesn't really matter. And
    what's happening now is:
  • 48:35 - 48:40
    I get this e-mail, this here will be
    decrypted from my mail client and I don't
  • 48:40 - 48:44
    see it because I won't scroll down. I'm a
    lazy person I'm a top poster. Right, now
  • 48:44 - 48:50
    you can go boo and so on, OK. But still I
    mean top posting is considered evil here.
  • 48:50 - 48:55
    Because I basically - the attacker was
    sending me an e-mail where ciphertext was
  • 48:55 - 49:00
    hidden in there that my e-mail client was
    decrypting and I was replying to this
  • 49:00 - 49:04
    e-mail sending the attacker the actual
    plain text that I just decrypted, without
  • 49:04 - 49:11
    knowing it. Okay that's silly. Okay. Come
    on. That's really silly. Okay. What are
  • 49:11 - 49:16
    you supposed to do now. What are the
    things that you should do. And the
  • 49:16 - 49:21
    important question here is you should ask
    yourself are you targeted by motivated
  • 49:21 - 49:23
    attackers?
    And a motivated attacker is not
  • 49:23 - 49:29
    necessarily the NSA or so, right? It can
    be just, I don't know, Cybercrime people or
  • 49:29 - 49:35
    so. I mean we we basically came up with
    these attacks with 8 people abd the better
  • 49:35 - 49:40
    part of a year. Which is not you know,
    which is a lot of research actually but
  • 49:40 - 49:45
    it's not like comparable to a nation
    state. Right. So if you're targeted by a
  • 49:45 - 49:50
    motivated attacker and if you say yeah you
    are probably targeted by motivated
  • 49:50 - 49:55
    attackers then avoid e-mail in total.
    E-mail is not made for secure
  • 49:55 - 50:02
    communication. Okay. If you can't avoid it
    and there's people who can't avoid using
  • 50:02 - 50:07
    e-mail they can't just use signal or any
    other chat client, then definitely use
  • 50:07 - 50:15
    OpenPGP and encrypt and decrypt outside of
    the mail client. If you are probably not
  • 50:15 - 50:22
    targeted by motivated attackers, which is
    most of you and I presume I would count to
  • 50:22 - 50:28
    the same people here, definitely prefer
    OpenPGP over S/mime because S/mime remains
  • 50:28 - 50:32
    broken. Right, there is a standard coming
    up which fixes most of the stuff. Disable
  • 50:32 - 50:39
    HTML for encrypted emails and this is like
    not that easy. Note that most email
  • 50:39 - 50:45
    clients use HTML by default and it might
    be okay if you fix it, the people that I
  • 50:45 - 50:51
    hear in the audience. But think of all the
    people who are not here in this audience,
  • 50:51 - 50:56
    who are not technically versed and so on
    and so on and they will not disable HTML,
  • 50:56 - 51:01
    right. So be careful with attachments
    which is also very difficult, how can you
  • 51:01 - 51:05
    be careful with attachments. Right. This
    is not very good. And don't top post,
  • 51:05 - 51:13
    don't cite text in a reply. Okay. That was
    my talk. If you want to meet us afterwards
  • 51:13 - 51:17
    we're gonna go to the Chaos West. There's
    a huge and lighted palm and we'll be there
  • 51:17 - 51:23
    if you have questions you can ask us
    there. Thank you very much.
  • 51:23 - 51:33
    applause
  • 51:33 - 51:38
    Herald: Thanks a lot Sebastian, for this
    interesting talk. We still have some time
  • 51:38 - 51:42
    for questions, so if you would like to ask
    some questions to Sebastian then please
  • 51:42 - 51:47
    queue up behind the microphones, and
    please try to be concise with your
  • 51:47 - 51:51
    question, and please get close to the
    microphone, because the mixing Angel in
  • 51:51 - 51:56
    the back is able to make it quieter, but
    hardly much louder, if your distance is
  • 51:56 - 51:59
    not right. So let's start with microphone
    number 2.
  • 51:59 - 52:06
    Microphone 2: Test, test. Hello. I'm
    actually tested the HTML exfiltrate you
  • 52:06 - 52:19
    described. But I found out, in
    Thunderbird, the HTML parsing of
  • 52:19 - 52:21
    Thunderbird was actually helping against
    the attack, because the word tags was just
  • 52:21 - 52:26
    disabled any possibility to exfiltrate the
    message, because there were some div tag,
  • 52:26 - 52:32
    which is closing your image tag at every
    point in time
  • 52:32 - 52:37
    Sebastian: Yeah, so, this is one of the
    fixes, that they did. I mean it doesn't
  • 52:37 - 52:41
    help with the cryptography, but it makes
    the exeltration a bit more difficult. If
  • 52:41 - 52:46
    you want to do the testing, try the
    versions from before May this year.
  • 52:46 - 52:49
    Microphone 2: I did, I did with the old
    versions.
  • 52:49 - 52:52
    Sebastian: We can talk afterwards if you
    want, and I will show it to you.
  • 52:52 - 52:57
    Herald: We are streaming all the talks on
    the Internet and we have people on the
  • 52:57 - 53:00
    internet that would like to ask a
    question, so please a question from the
  • 53:00 - 53:03
    internet.
    Signal Angel: Yeah, so there were actually
  • 53:03 - 53:04
    many questions in the direction of
    problems with MIME standards. So, like,
  • 53:04 - 53:05
    what they were asking was basically
    "Woudn't the exploitation be prevented, if
  • 53:05 - 53:21
    the email clients would handle the
    standart correctly?"
  • 53:21 - 53:27
    Sebastian: Mhm, okay. So, I am not sure
    whether they meant the MIME standards or
  • 53:27 - 53:32
    the S/MIME standards. So basically, the
    MIME standards are that one to blame for
  • 53:32 - 53:37
    the direct exoltration attacks, were you
    have multiple MIME-parts that are mixed
  • 53:37 - 53:43
    together, and the MIME standards don't
    state explicitly how to do this. So they
  • 53:43 - 53:48
    don't have any rules of how to handle it,
    and basically I think, as a rule of thumb,
  • 53:48 - 53:54
    when you try to be concise and complete
    with implementing the MIME standard you
  • 53:54 - 53:59
    were vulnerable, and if you were just lazy
    and just for example decrypted the first
  • 53:59 - 54:04
    MIME-part or so you were not vulnerable.
    So, leaving out much of the stuff made you
  • 54:04 - 54:09
    more secure, which is weird.
    Herald: Thank you for the answer. We have
  • 54:09 - 54:13
    another question in this hall, on
    microphone number 6, and please remember
  • 54:13 - 54:14
    to be concise and get close to the
    microphone.
  • 54:14 - 54:17
    Microphone 6: What do you see
    Audio feedback loop
  • 54:17 - 54:20
    Microphone 6: Sorry.
    Herald: Very good! We can always make it
  • 54:20 - 54:21
    quieter.
    Applause
  • 54:21 - 54:22
    Herald: Laughing
  • 54:22 - 54:26
    Microphone 6: What do you see as a future
  • 54:26 - 54:31
    replacement to PGP for email encryption?
    Sebastian: So actually, we brainstormed a
  • 54:31 - 54:38
    little, because PGP lacks many of the
    modern properties, like forward secrecy
  • 54:38 - 54:43
    and stuff like this, but it turns out that
    it's not very easy to do this. Especially
  • 54:43 - 54:50
    not with - when you don't want to do
    changes to SMTP and IMAP. So, it's gonna
  • 54:50 - 54:57
    be difficult. It's gonna be difficult to
    make it more secure than PGP, besides the
  • 54:57 - 55:05
    critisism that I already brought in. So,
    E-Mail is not a very good protocol, or the
  • 55:05 - 55:09
    protocols that are built in E-Mail are not
    a very good to build proper crypto on top
  • 55:09 - 55:13
    of it.
    Herald: Thank you for this answer, so
  • 55:13 - 55:18
    maybe we need build something entirely new
    from scratch. There is another question on
  • 55:18 - 55:20
    Microphone number 2, if I see this
    correctly.
  • 55:20 - 55:26
    Microphone 2: So, do I understand it
    correctly, it looks like there won't be a
  • 55:26 - 55:33
    fix for that multi part attacks, like
    there is the normal plain text the
  • 55:33 - 55:37
    attacker writes, and then there is a
    ciphertext, which my mail client decrypts;
  • 55:37 - 55:41
    there won't be a fix for that?
    Sebastian: There is a fix, so the mail
  • 55:41 - 55:45
    clients are fixed, so that's because
    that's a non-breaking fix, that's a good
  • 55:45 - 55:49
    thing here. So you can't fix S/MIME, for
    example, because it would be a breaking
  • 55:49 - 55:55
    fix, but you could fix the email clients,
    which was a lot of work, because MIME
  • 55:55 - 55:59
    parsers are very complex, but they fixed
    it, so it's not supposed to work in
  • 55:59 - 56:03
    current mail clients anymore. The direct
    exfiltration part.
  • 56:03 - 56:08
    Herald: So we still have quite some time
    left and so I would like to have another
  • 56:08 - 56:11
    question form the internet.
    Signal Angel: Yes, so one user asked
  • 56:11 - 56:14
    "would you recommend a better
    path to integrate PGP into the E-Mail
  • 56:14 - 56:27
    clients instead of using extensions?"
    Sebastian: Yea. I'm not a - I mean
  • 56:27 - 56:32
    I already talked about this that not many
    people use PGP. And also not many people
  • 56:32 - 56:37
    use S/MIME.
    I'm not sure, whether this will be
  • 56:37 - 56:45
    increased, when OpenPGP spilled into most
    of the mail clients, because you could use
  • 56:45 - 56:51
    S/MIME, you know. As soon as S/MIME is
    fixed it will be fine to use S/MIME, and
  • 56:51 - 56:55
    it's already in all the clients in there,
    but not many people use it.
  • 56:55 - 57:00
    So it would be nice, if we could have it,
    but I'm not sure whether it would have
  • 57:00 - 57:07
    much of an effect on the amount of people
    who use it. Herald Angel: Thank you. And
  • 57:07 - 57:11
    we have another question from Microphone
    number 7.
  • 57:11 - 57:17
    Microphone 7: Yes, hello. So I work with
    journalists - here! here! here!
  • 57:17 - 57:20
    Herald Angel: There, in the very back.
    Microphone 7: There, Hello. Hello.
  • 57:20 - 57:22
    Sebastian: Hi. Oh, yeah hi. How's it
    going?
  • 57:22 - 57:27
    Microphone 7: So I work with journalists,
    and May was very annoying, and I cannot
  • 57:27 - 57:32
    stress enough how important it is to - the
    point you've made about communicating
  • 57:32 - 57:33
    around disclosure.
    Sebastion: Yeah
  • 57:33 - 57:37
    Microphone 7: We were scrambling. I work
    with about 200 journalists, who use PGP
  • 57:37 - 57:41
    daily, and we were scrambling for any bit
    of information.
  • 57:41 - 57:43
    Sebastian: Yeah.
    Microphone 7: What, what should we do? It
  • 57:43 - 57:44
    was, it was madness.
    Sebastian: Yes.
  • 57:44 - 57:49
    Microphone 7: But I actually have a
    question. The question is: Have you played
  • 57:49 - 57:56
    with Mailpile? I've read the, I've read
    the paper. In the paper Mailpile, I think
  • 57:56 - 58:02
    I remember, was mentioned, and I vaguely
    remember it was mentioned in a positive
  • 58:02 - 58:08
    light, but I just want to make sure, if
    that's the right thing that I should get
  • 58:08 - 58:10
    from this paper.
    Sebastian: I don't know it on the top of
  • 58:10 - 58:16
    my head, but if you come afterwards to
    Chaos West we'll get out the paper and
  • 58:16 - 58:19
    look at the tests, and then we can answer
    this question. Cool.
  • 58:19 - 58:22
    Microphone 7: Thank you.
    Herald: Okay. We have another question on
  • 58:22 - 58:28
    the microphone number 6.
    Microphone 6: So, I'd like to know if
  • 58:28 - 58:37
    there's any difference in the attack
    surface, regarding OpenPGP, if plain,
  • 58:37 - 58:47
    like, plain PGP is used or PGP/MIME. For
    example if you set your E-Mail client to
  • 58:47 - 58:58
    disallow decryption of inline PGP.
    Sebastian: Yeah, that's a very good
  • 58:58 - 59:02
    question.
    I mean the reply to attacker attack that I
  • 59:02 - 59:08
    just showed at the last. The Q53 people
    came up with a version that worked with
  • 59:08 - 59:16
    inline PGP, and we showed that it's also
    possible with PGP/MIME. So, I wouldn't say
  • 59:16 - 59:22
    - I mean, most of the people use PGP/MIME.
    Inline PGP is not used anymore. The
  • 59:22 - 59:27
    problem is, when you don't decrypt PGP,
    inline PGP, then you have a problem when
  • 59:27 - 59:33
    people use PGP at an external application.
    They can't copy and paste the ciphertext
  • 59:33 - 59:37
    in there anymore, which is also very
    annoying. And I also told you that it's, I
  • 59:37 - 59:41
    think it's a very good idea to do this
    outside of the mail client, if you're in
  • 59:41 - 59:48
    a, if you face motivated attackers. So,
    it's not that easy. it would be a breaking
  • 59:48 - 59:50
    change that wouldn't, maybe not be too
    good.
  • 59:50 - 59:54
    Microphone 6: Okay. Thanks.
    Sebastian: Okay.
  • 59:54 - 59:59
    Herald: Thanks a lot for this answer. I
    think we are done with all the questions
  • 59:59 - 60:03
    from the hall. If you like to continue the
    discussion with Sebastian Schinzel, you
  • 60:03 - 60:09
    may move yourself to the assembly of Chaos
    West in the next hall in this direction.
  • 60:09 - 60:12
    And now please give a big round of
    applause for Sebastian Schinzel and the
  • 60:12 - 60:15
    awesome team behind.
    Applause
  • 60:15 - 60:19
    Outro plays
  • 60:19 - 60:38
    subtitles created by c3subtitles.de
    in the year 2020. Join, and help us!
Title:
35C3 - Attacking end-to-end email encryption
Description:

more » « less
Video Language:
English
Duration:
01:00:38

English subtitles

Revisions