pg.ddx.io  pgpool-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Taiki Koshino <koshino@sraoss.co.jp>
To: pgpool-committers@lists.postgresql.org
Subject: pgpool: Reject client certificate CN containing embedded NUL byte.
Date: Tue, 29 Sep 2026 04:44:17 +0000
Message-ID: <E1xBPhR-00000002h2G-13k5@gothos.postgresql.org> (raw)

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.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92868
Backpatch-through: v4.3

Branch
------
V4_3_STABLE

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

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



view thread (6+ messages)  latest in thread

Message-ID: <E1xBPhR-00000002h2G-13k5@gothos.postgresql.org>
Permalink:  ../E1xBPhR-00000002h2G-13k5@gothos.postgresql.org/
Also on:    postgresql.org/message-id/E1xBPhR-00000002h2G-13k5@gothos.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: pgpool-committers@postgresql.org
  Cc: koshino@sraoss.co.jp
  Subject: Re: pgpool: Reject client certificate CN containing embedded NUL byte.
  In-Reply-To: <E1xBPhR-00000002h2G-13k5@gothos.postgresql.org>
  References: <E1xBPhR-00000002h2G-13k5@gothos.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