unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: notmuch@notmuchmail.org
Subject: Re: Inline-encryption, encryption failure when storing sent mails
Date: Tue, 20 Aug 2013 13:03:27 -0400	[thread overview]
Message-ID: <5213A15F.30109@fifthhorseman.net> (raw)
In-Reply-To: <878v02ysfg.fsf@maritornes.cs.unb.ca>

[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]

On 08/16/2013 04:02 AM, David Bremner wrote:
> Simon Hirscher <public@simonhirscher.de> writes:
> 
>> 1. Support for inline-encryption As far as I can see, so far only
>> encrypted mails with PGP/MIME are supported. Couldn't notmuch also
>> support text/plain messages that contain PGP-encrypted messages by
>> scanning for "^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"? – as suggested in
>> a previous message to this mailing list
>> (id:87zl3az8mm.fsf@lillypad.riseup.net; web view:
> 
> If someone feels inspired to work on this, maybe 
> 
>    notmuch-wash-convert-inline-patch-to-part
> 
> (in notmuch-watch.el) might be a reasonable place to start.

if anyone does feel inclined to work on this, please consider that
dealing cleanly an inline-signed message has a number of serious
problems, not least of which is the Content-Type.

I've been meaning to write this up more cleanly, but a summary here will
have to do for now:

The MIME Content-Type header for an inline-PGP-signed e-mail message is
not signed.  This means that an attacker can replay a signed message
while undetectably changing the Content-Type.  One example of such an
attack is to leave the base Content-Type as text/plain but to switch
charsets -- the same bytestream can then be interpreted differently.

For example, depending on the charset, the same bytestream can be
represented as:

 The rental is €13/week for unit 7.

[charset=big5]

or:

 The rental is £ב13/week for unit 7.

[charset=iso-8859-8]

since 1GBP = 1.17EUR, this represents a change of 17% in the value of
the signed message while retaining the signature's validity :P

Given that you don't have cryptographically-reliable Content-Type
information, will you be comfortable indicating that the message is
actually signed?

Also, inline-signed messages may not span the entire part.  That is, a
message could have a bit of unsigned text above or below the
inline-signature.  The current user-facing UI in notmuch-emacs indicates
whether each part is individually signed or not.  How would
notmuch-emacs indicate reliably to the user that only a portion of the
part is signed?

In short: inline PGP is a mess, and existing implementations which try
to cope with it have severe shortcomings.  I'd rather avoid introducing
new types of failure to notmuch.

	--dkg


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 1027 bytes --]

  parent reply	other threads:[~2013-08-20 17:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 16:57 Inline-encryption, encryption failure when storing sent mails Simon Hirscher
2013-08-16  8:02 ` David Bremner
2013-08-16 11:32   ` Simon Hirscher
2013-08-20 17:03   ` Daniel Kahn Gillmor [this message]
2014-02-18 18:31     ` Daniel Kahn Gillmor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5213A15F.30109@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).