pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: pgcrypto: Report errant decryption as "Wrong key or corrupt data
Date: Mon, 18 May 2015 14:04:02 +0000
Message-ID: <E1YuLeE-000660-Qb@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

pgcrypto: Report errant decryption as "Wrong key or corrupt data".

This has been the predominant outcome.  When the output of decrypting
with a wrong key coincidentally resembled an OpenPGP packet header,
pgcrypto could instead report "Corrupt data", "Not text data" or
"Unsupported compression algorithm".  The distinct "Corrupt data"
message added no value.  The latter two error messages misled when the
decrypted payload also exhibited fundamental integrity problems.  Worse,
error message variance in other systems has enabled cryptologic attacks;
see RFC 4880 section "14. Security Considerations".  Whether these
pgcrypto behaviors are likewise exploitable is unknown.

In passing, document that pgcrypto does not resist side-channel attacks.
Back-patch to 9.0 (all supported versions).

Security: CVE-2015-3167

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fba1fb4efba51587cd0a9817af1f3e629caf157a

Modified Files
--------------
contrib/pgcrypto/expected/pgp-decrypt.out        |   51 ++++++++++++++++
contrib/pgcrypto/expected/pgp-pubkey-decrypt.out |    4 +-
contrib/pgcrypto/mbuf.c                          |    2 +-
contrib/pgcrypto/pgp-decrypt.c                   |   70 ++++++++++++++++------
contrib/pgcrypto/pgp.h                           |    4 +-
contrib/pgcrypto/px.c                            |    3 -
contrib/pgcrypto/px.h                            |    2 -
contrib/pgcrypto/sql/pgp-decrypt.sql             |   45 ++++++++++++++
doc/src/sgml/pgcrypto.sgml                       |    8 +++
9 files changed, 162 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1YuLeE-000660-Qb@gemulon.postgresql.org>
Permalink:  ../E1YuLeE-000660-Qb@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YuLeE-000660-Qb@gemulon.postgresql.org

 · 

reply

Reply instructions:

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

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: pgcrypto: Report errant decryption as "Wrong key or corrupt data
  In-Reply-To: <E1YuLeE-000660-Qb@gemulon.postgresql.org>
  References: <E1YuLeE-000660-Qb@gemulon.postgresql.org>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox