Mailing List Archive

FW: Serious bug in PGP - versions 5 and 6
Sounds serious to me....Any comments from NAI staff?



Regards,

Sam Simpson
http://www.scramdisk.clara.net/

> -----Original Message-----
> From: Ross Anderson [mailto:Ross.Anderson@cl.cam.ac.uk]
> Sent: 24 August 2000 07:57
> To: ukcrypto@maillist.ox.ac.uk
> Subject: Serious bug in PGP - versions 5 and 6
>
>
> Ralf Senderek has found a horrendous bug in PGP versions 5 and 6.
> It's of scientific interest because it spectacularly confirms a
> prediction made by a number of us in the paper on `The Risks of Key
> Recovery, Key Escrow, and Trusted Third-Party Encryption'
> <http://www.cdt.org/crypto/risks98/> that key escrow would make it
> much more difficult than people thought to build secure systems.
>
> He's written a paper on his work and it's at
>
> http://senderek.de/security/key-experiments.html
>
> Since NAI joined the Key Recovery Alliance, PGP has supported
> "Additional Decryption Keys" which can be added to a public key. The
> sender will then encrypt the session key to these as well as to your
> main public key. The bug is that some versions of PGP respond to ADK
> subpackets in the non-signed part of the public key data structure.
> The effect is that GCHQ can create a tampered version of your PGP
> public key containing a public key whose corresponding private key is
> also known to themselves, and circulate it. People who encrypt traffic
> to you will encrypt it to them too.
>
> The problem won't go away until all vulnerable versions of PGP are
> retired, since it's the sender who is responsible for encrypting to
> the ADKs, not the recipient.
>
> In the meantime there might be a nasty denial-of-service attack in
> which bad guys upload tampered versions of everybody's public keys to
> all the public keyrings.
>
> Ross
>
>
> > PS: my student Steve Early has trawled the PGP-6.5.1i-beta2 source
> > code and found the bug:
> >
> > In file libs/pgpcdk/priv/keys/keys/pgpRngPub.c, I see two functions:
> > one called ringKeyFindSubpacket(), which finds a subpacket from a
> > self-signature packet, and ringKeyAdditionalRecipientRequestKey(),
> > which uses ringKeyFindSubpacket() to search for ADK subpackets.
> >
> > ringKeyFindSubpacket() is declared as follows:
> >
> > PGPByte const *
> > ringKeyFindSubpacket (RingObject *obj, RingSet const *set,
> > int subpacktype, unsigned nth,
> > PGPSize *plen, int *pcritical, int *phashed,
> PGPUInt32 *pcreation,
> > unsigned *pmatches, PGPError *error);
> >
> > In particular, the "phashed" parameter is used to return whether the
> > subpacket was in the hashed region. Now, looking at the call in
> > ringKeyAdditionalRecipientRequestKey() I see this:
> >
> > krpdata = ringKeyFindSubpacket (obj, set,
> > SIGSUB_KEY_ADDITIONAL_RECIPIENT_REQUEST,
> nth, &krdatalen,
> > &critical, NULL, NULL, &matches, error);
> >
> > ...the "phashed" value isn't checked (or even asked for)!
> >
> >
> > Fixing the bug, and generating BIG WARNINGS when ADKs are
> found in the
> > non-hashed area, should be trivial.
>
>

--
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of "unsubscribe" to gnupg-users-request@gnupg.org
FW: Serious bug in PGP - versions 5 and 6 [ In reply to ]
Further to my previous mail, Stephen has gone some way towards identifying
which versions are vulnerable (see note below). The worrying part to me is:
"The problem won't go away until all vulnerable versions of PGP are retired,
since it's the sender who is responsible for encrypting to the ADKs, not the
recipient."


Can anyone with 5.5.3i confirm that the default action is to warn when
encrypting to ADKs?


Regards,

Sam Simpson
http://www.scramdisk.clara.net/

> -----Original Message-----
> From: Stephen Early [mailto:Stephen.Early@cl.cam.ac.uk]
> Sent: 24 August 2000 11:12
> To: ukcrypto@maillist.ox.ac.uk
> Subject: Re: Serious bug in PGP - versions 5 and 6
>
>
> Brian Morrison writes:
> > On Thu, 24 Aug 2000 08:09:07 +0100, Ross Anderson wrote:
> > >The problem won't go away until all vulnerable versions of PGP are
> > >retired, since it's the sender who is responsible for encrypting to
> > >the ADKs, not the recipient.
> >
> > The key issue from my point of view is which PGP versions
> exhibit this
> > bug. Is there a list by OS for instance? Might this exist within
> > products that use the PGP SDK?
>
> Yes - the bug I found was within the PGP SDK from NAI.
>
> At a guess (i.e. without finding and checking the source code to all
> available versions) I would say that the bug exists in all versions of
> PGP and the PGP SDK from NAI since the ADK feature was implemented.
>
>
> The original paper is at
> http://senderek.de/security/key-experiments.html - it is quite
> detailed. I sent Ross a simple summary, which I reproduce here:
>
> When a PGP key-pair is generated, the public key is stored in a file
> as a number of typed 'packets': the key itself, a userid, etc. One of
> these packets is a signature of the previous packets made with the
> private key, to bind them together (so that, for example, the userid
> cannot be changed).
>
> In PGP version 3 files, it's as simple as that.
>
> In PGP version 4 files, the signature packet contains some extra
> fields: two sets of 'subpackets'. One set of subpackets is included in
> the hash, and therefore cannot be tampered with. The other is not
> included in the hash.
>
> Some versions of PGP allow "Additional Decryption Keys" to be
> specified for public keys. They are specified by including the
> additional key identity in a subpacket in the signature. The idea is
> that when you create a key pair and sign the public part, you sign the
> identities of any ADKs that you want to use. This is supposed to
> prevent ADKs from being specified without the consent of the holder of
> the private key.
>
> Unfortunately, some versions of PGP respond to ADK subpackets in the
> non-hashed part of the signature. This is a blatant bug. They treat
> them exactly as if they were hashed, i.e. they show up as ADKs in the
> list of 'key properties', and messages encrypted to the public key
> include packets allowing the session key to be obtained by holders of
> the ADKs.
>
> Tested versions of PGP:
>
> PGP-2.6.3ia UNIX (not vulnerable - doesn't support V4 signatures)
> PGP-5.0i UNIX (not vulnerable)
> PGP-5.5.3i WINDOWS (VULNERABLE)
> PGP-6.5.1i WINDOWS (VULNERABLE)
> GnuPG-1.0.1 UNIX (not vulnerable)
>
> The problem won't go away until all vulnerable versions of PGP are
> retired, since it's the sender who is responsible for encrypting to
> the ADKs, not the recipient.
>
> As far as I can tell, nobody has done the experiment of uploading a
> modified signature packet to a keyserver yet - will it replace the
> existing signature packet, or be ignored? (Or possibly be stored in
> addition, in which case more experiments need to be done: what will
> various versions of PGP do if given keys with multiple
> self-signatures?)
>
>
> Programs like gnupg can be used to list pgp files at the packet level;
> you can look to see whether messages you receive have been encrypted
> to additional keys (gpg --list-packets). You can also look at public
> keys and check for ADK subpackets in the non-hashed part of the
> self-signature.
>
> Steve Early
>
>

--
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of "unsubscribe" to gnupg-users-request@gnupg.org
FW: Serious bug in PGP - versions 5 and 6 [ In reply to ]
Further insightful comments from Adam Back (a "good guy" from the UK).



Regards,

Sam Simpson
http://www.scramdisk.clara.net/

> -----Original Message-----
> From: Adam Back [mailto:adam@cypherspace.org]
> Sent: 24 August 2000 15:12
> To: Ross.Anderson@cl.cam.ac.uk
> Cc: ukcrypto@maillist.ox.ac.uk; ietf-openpgp@imc.org
> Subject: Re: Serious bug in PGP - versions 5 and 6
>
>
>
> Ross Anderson writes on uk-crypto:
> > Ralf Senderek has found a horrendous bug in PGP versions 5 and 6.
> >
> > [...]
> >
> > He's written a paper on his work and it's at
> >
> > http://senderek.de/security/key-experiments.html
> >
> > Since NAI joined the Key Recovery Alliance, PGP has supported
> > "Additional Decryption Keys" which can be added to a public key.
> >
> > The sender will then encrypt the session key to these as well as to
> > your main public key. The bug is that some versions of PGP respond
> > to ADK subpackets in the non-signed part of the public key data
> > structure. The effect is that GCHQ can create a tampered version of
> > your PGP public key containing a public key whose corresponding
> > private key is also known to themselves, and circulate it. People
> > who encrypt traffic to you will encrypt it to them too.
>
> Amazing, and really unfortunate. Those of us who invested large
> amounts of effort in ensuring the ADK subpackets were not included in
> the ietf openPGP standard can be pleased we succeeded -- otherwise
> gnuPG and other implementations may now also have contributed to this
> risk. As it is gnuPG doesn't honor ADK requests, and all the rfc2440
> says about them is:
>
> 10 = placeholder for backward compatibility
>
> At the time I was suggesting that if PGP really must insist on
> creating software to escrow communications (the primary argument being
> that people didn't want to lose access to the stored mail as opposed
> to being able to have designated third parties snooping mail in
> transit) they should use storage key escrow.
>
> My main premise was that communication key escrow is too risky because
> an outside attacker gets the plaintext:
>
http://www.cypherspace.org/~adam/cdr/

"Keys used to encrypt email which is transmitted over the Internet are
more valuable to an attacker than keys used to encrypt stored files
because of the relative ease with which an attacker can obtain copies
of emailed ciphertext. Stored encrypted files in contrast are
protected by all the physical security systems the company is relying
on to protect it's paper files, plaintext data stored on disks, and
backup tapes. [...]"

There was also lots of political discussion of how unwise it was for
PGP to create a escrow infrastructure which could as easily be used by
governments as by SEC companies to archive their employees
communications.

And people quoting Phil Zimmermann a few years earlier complaining
about ViaCrypt's PGP4 for business variant which had "escrow" in the
form of a third party "encrypt-to-self" config file setting.

And I believe I recall the NSA or some other US government body
picking up on the CMR / ADK mechanism and holding it up as evidence
against the claim that key recover was complex ... "see PGP did it,
this works".

> It's of scientific interest because it spectacularly confirms a
> prediction made by a number of us in the paper on `The Risks of Key
> Recovery, Key Escrow, and Trusted Third-Party Encryption'
> <http://www.cdt.org/crypto/risks98/> that key escrow would make it
> much more difficult than people thought to build secure systems.

Yes. It really highlights the truth in the statement about the
new risks introduced by adding key escrow.

Adam

--
Archive is at http://lists.gnupg.org - Unsubscribe by sending mail
with a subject of "unsubscribe" to gnupg-users-request@gnupg.org