pgpool: Reject client certificate CN containing embedded NUL byte.

From: Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Reject client certificate CN containing embedded NUL byte.
Date: 2026-09-29 04:47:05
Message-ID: E1xBPk9-00000002ivo-2gVM@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

Reject client certificate CN containing embedded NUL byte.

X509_NAME_get_text_by_NID returns the ASN.1 byte length of the Common
Name string. pgpool stored the buffer as a C string and later compared
it to the HBA-supplied username with strcasecmp(). If the certificate
CN contains an embedded NUL byte (e.g. "target\0attacker"), the
ASN.1-length view of the name and the C-string view disagree:
strcasecmp() truncates at the embedded NUL, so a peer presenting a
maliciously crafted certificate authenticates as the prefix.

Reject the certificate when the C-string length of the extracted CN
differs from the byte length returned by X509_NAME_get_text_by_NID().

Reported-by: Emond Papegaaij <emond(dot)papegaaij(at)topicus(dot)nl>
Reported-by: Claude
Author: Bo Peng <pengbo(at)sraoss(dot)co(dot)jp>
CVE-2026-92868
Backpatch-through: v4.3

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=d0a783343ce8e6331a78e2d086b184f504d15b84

Modified Files
--------------
src/utils/pool_ssl.c | 6 ++++++
1 file changed, 6 insertions(+)

Browse pgpool-committers by date

  From Date Subject
Next Message pgpool-committers-owner 2026-09-29 04:47:25 pgpool: Tag refs/tags/V4_7_3 was created
Previous Message Taiki Koshino 2026-09-29 04:44:17 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo