| From: | Noah Misch <noah(at)leadboat(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix errorhandling for PGP encryption |
| Date: | 2026-08-10 13:41:26 |
| Message-ID: | E1wtQFq-00000000yBI-2Aig@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix errorhandling for PGP encryption
PGP encryption was using px_cipher_encrypt without checking if any
error was returned. When OpenSSL is running in FIPS mode, or when
the legacy provider hasn't been loaded, not all ciphers which are
supported by the PGP code are available and fail the init step in
px_cipher_encrypt. Since the PGP encryption failed to notice this
it XORed the non-encrypted block with the plaintext, effectively
disabling the encryption.
This was found due to a report of PGP encryption not respecting
the pgcrypto.builtin_crypto_enabled flag and allowing Blowfish
and DES. This however turned out to be a false positive, since
the PGP code only use ciphers from OpenSSL and not the built in
ciphers.
Bug: #19457
Reported-by: Shishir Sharma <ansh01072001(at)gmail(dot)com>
Reviewed-by: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Discussion: https://postgr.es/m/19457-4bab15c17aea36c7@postgresql.org
Security: CVE-2026-14663
Backpatch-through: 14
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/fe32b10fca5342b9f86848a55288f6143b3afa04
Author: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
Modified Files
--------------
contrib/pgcrypto/expected/pgp-decrypt_1.out | 2 +-
contrib/pgcrypto/expected/pgp-encrypt_1.out | 192 +++++++++++++++++++++
contrib/pgcrypto/expected/pgp-pubkey-decrypt_1.out | 2 +-
contrib/pgcrypto/pgp-cfb.c | 8 +-
doc/src/sgml/pgcrypto.sgml | 5 +
5 files changed, 206 insertions(+), 3 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Noah Misch | 2026-08-10 13:41:27 | pgsql: Reject GSSEncRequest after direct SSL connection |
| Previous Message | Noah Misch | 2026-08-10 13:41:25 | pgsql: Add an output_plugin_libraries GUC to bless trusted output plugi |