~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-security

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/sql/pgp-decrypt.sql

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2015-05-20 23:08:58 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20150520230858-qz4hhfmqoqw4cqxe
Tags: 9.3.7-0ubuntu0.14.04
* New upstream security/bug fix release (LP: #1457093)
  - Avoid possible crash when client disconnects just before the
    authentication timeout expires.
    If the timeout interrupt fired partway through the session shutdown
    sequence, SSL-related state would be freed twice, typically causing a
    crash and hence denial of service to other sessions.  Experimentation
    shows that an unauthenticated remote attacker could trigger the bug
    somewhat consistently, hence treat as security issue. (CVE-2015-3165)

  - Improve detection of system-call failures
    Our replacement implementation of snprintf() failed to check for errors
    reported by the underlying system library calls; the main case that
    might be missed is out-of-memory situations. In the worst case this
    might lead to information exposure, due to our code assuming that a
    buffer had been overwritten when it hadn't been. Also, there were a few
    places in which security-relevant calls of other system library
    functions did not check for failure.
    It remains possible that some calls of the *printf() family of functions
    are vulnerable to information disclosure if an out-of-memory error
    occurs at just the wrong time.  We judge the risk to not be large, but
    will continue analysis in this area. (CVE-2015-3166)

  - In contrib/pgcrypto, uniformly report decryption failures as Wrong key
    or corrupt data
    Previously, some cases of decryption with an incorrect key could report
    other error message texts.  It has been shown that such variance in
    error reports can aid attackers in recovering keys from other systems.
    While it's unknown whether pgcrypto's specific behaviors are likewise
    exploitable, it seems better to avoid the risk by using a
    one-size-fits-all message. (CVE-2015-3167)

  - Protect against wraparound of multixact member IDs
    Under certain usage patterns, the existing defenses against this might
    be insufficient, allowing pg_multixact/members files to be removed too
    early, resulting in data loss.
    The fix for this includes modifying the server to fail transactions that
    would result in overwriting old multixact member ID data, and improving
    autovacuum to ensure it will act proactively to prevent multixact member
    ID wraparound, as it does for transaction ID wraparound.

 - See release notes for details about other fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
-- check BUG #11905, problem with messages 6 less than a power of 2.
269
269
select pgp_sym_decrypt(pgp_sym_encrypt(repeat('x',65530),'1'),'1') = repeat('x',65530);
270
270
-- expected: true
 
271
 
 
272
 
 
273
-- Negative tests
 
274
 
 
275
-- Decryption with a certain incorrect key yields an apparent Literal Data
 
276
-- packet reporting its content to be binary data.  Ciphertext source:
 
277
-- iterative pgp_sym_encrypt('secret', 'key') until the random prefix gave
 
278
-- rise to that property.
 
279
select pgp_sym_decrypt(dearmor('
 
280
-----BEGIN PGP MESSAGE-----
 
281
 
 
282
ww0EBwMCxf8PTrQBmJdl0jcB6y2joE7GSLKRv7trbNsF5Z8ou5NISLUg31llVH/S0B2wl4bvzZjV
 
283
VsxxqLSPzNLAeIspJk5G
 
284
=mSd/
 
285
-----END PGP MESSAGE-----
 
286
'), 'wrong-key', 'debug=1');
 
287
 
 
288
-- Routine text/binary mismatch.
 
289
select pgp_sym_decrypt(pgp_sym_encrypt_bytea('P', 'key'), 'key', 'debug=1');
 
290
 
 
291
-- Decryption with a certain incorrect key yields an apparent BZip2-compressed
 
292
-- plaintext.  Ciphertext source: iterative pgp_sym_encrypt('secret', 'key')
 
293
-- until the random prefix gave rise to that property.
 
294
select pgp_sym_decrypt(dearmor('
 
295
-----BEGIN PGP MESSAGE-----
 
296
 
 
297
ww0EBwMC9rK/dMkF5Zlt0jcBlzAQ1mQY2qYbKYbw8h3EZ5Jk0K2IiY92R82TRhWzBIF/8cmXDPtP
 
298
GXsd65oYJZp3Khz0qfyn
 
299
=Nmpq
 
300
-----END PGP MESSAGE-----
 
301
'), 'wrong-key', 'debug=1');
 
302
 
 
303
-- Routine use of BZip2 compression.  Ciphertext source:
 
304
-- echo x | gpg --homedir /nonexistent --personal-compress-preferences bzip2 \
 
305
--      --personal-cipher-preferences aes --no-emit-version --batch \
 
306
--      --symmetric --passphrase key --armor
 
307
select pgp_sym_decrypt(dearmor('
 
308
-----BEGIN PGP MESSAGE-----
 
309
 
 
310
jA0EBwMCRhFrAKNcLVJg0mMBLJG1cCASNk/x/3dt1zJ+2eo7jHfjgg3N6wpB3XIe
 
311
QCwkWJwlBG5pzbO5gu7xuPQN+TbPJ7aQ2sLx3bAHhtYb0i3vV9RO10Gw++yUyd4R
 
312
UCAAw2JRIISttRHMfDpDuZJpvYo=
 
313
=AZ9M
 
314
-----END PGP MESSAGE-----
 
315
'), 'key', 'debug=1');