From: Taiki Koshino <koshino@sraoss.co.jp>
To: pgpool-committers@lists.postgresql.org
Subject: pgpool: Bound wd_nodes JSON array parsing in get_pool_config_from_json.
Date: Tue, 29 Sep 2026 04:43:39 +0000
Message-ID: <E1xBPgp-00000002gdt-2bHE@gothos.postgresql.org> (raw)
Bound wd_nodes JSON array parsing in get_pool_config_from_json.
In src/watchdog/wd_json_data.c get_pool_config_from_json(), the loop
over the peer-supplied "wd_nodes" JSON array writes into
config->wd_nodes.wd_node_info[i] using the array length declared by
the peer. The destination is a fixed-size array of MAX_WATCHDOG_NUM
(128) WdNodeInfo entries (see WdNodesConfig in src/include/pool_config.h),
but no upper bound is enforced before the loop, so a peer that ships
a wd_nodes array of length > 128 walks the loop index past the end
of the array and writes peer-controlled host/port data into adjacent
heap memory.
This is the wd_nodes half of PGP-0001 (the backend_desc half is
addressed in a sibling patch). Reject any wd_nodes array whose
declared length exceeds MAX_WATCHDOG_NUM via ereport(ERROR, ...) so
the JSON is dropped before any out-of-bounds write occurs.
Inline bound check (rather than a shared parse_peer_count helper) so
this patch is self-contained and back-portable independently of any
helper migration.
Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92869
Backpatch-through: v4.3
Branch
------
V4_5_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a8ce0fdd9ebb9fcd5507f169f76cf875233e4...
Modified Files
--------------
src/watchdog/wd_json_data.c | 6 ++++++
1 file changed, 6 insertions(+)
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: Bound wd_nodes JSON array parsing in get_pool_config_from_json.
In-Reply-To: <E1xBPgp-00000002gdt-2bHE@gothos.postgresql.org>
References: <E1xBPgp-00000002gdt-2bHE@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