pg.ddx.io  pgpool-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
6+ messages / 1 participants
[nested] [flat]

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:41  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:41 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
V4_7_STABLE

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:43  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:43 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
V4_6_STABLE

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:43  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:43 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
V4_5_STABLE

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:43  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:43 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
V4_4_STABLE

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:44  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:44 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
V4_3_STABLE

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo
@ 2026-09-29 04:47  Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-29 04:47 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

NULL-check json_get_value_for_key inputs and outputs in watchdog auth path.

A peer that opens a TCP connection to wd_port and sends a well-formed
WD_ADD_NODE_MESSAGE whose JSON body omits the "authkey" field reaches
verify_authhash_for_node() with authhash == NULL.  When wd_authkey is
configured, the function calls strcmp(calculated_authhash, authhash)
unconditionally, faulting the watchdog process.  Because PT_WATCHDOG is
respawned by the parent, an attacker can loop the request and deny all
cluster coordination (no failover, no quorum, no state transitions) for
as long as the connection is reachable.

The same shape exists one layer down in json_get_value_for_key(): the
function dereferences source->type without checking source first.  Any
chained call of the form json_get_value_for_key(json_get_value_for_key(
root, "X"), "Y") -- where the inner lookup returns NULL because the
peer omitted the field -- crashes the watchdog the same way.

Add minimal NULL guards in both places:

  * json_get_value_for_key() returns NULL when source is NULL, matching
    the contract the existing callers (json_get_int_value_for_key,
    json_get_string_value_for_key, etc.) already assume on its return
    value.
  * verify_authhash_for_node() rejects the peer with ereport(WARNING)
    when the parsed authhash is NULL, so a missing authkey field is
    treated as authentication failure rather than a crash.

Reported-by: Emond Papegaaij <emond.papegaaij@topicus.nl>
Reported-by: Claude
Author: Bo Peng <pengbo@sraoss.co.jp>
CVE-2026-92871
Backpatch-through: v4.3

Branch
------
master

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

Modified Files
--------------
src/utils/json.c        |  2 ++
src/watchdog/watchdog.c | 10 ++++++++++
2 files changed, 12 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-09-29 04:47 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 04:41 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>
2026-09-29 04:43 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>
2026-09-29 04:43 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>
2026-09-29 04:43 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>
2026-09-29 04:44 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>
2026-09-29 04:47 pgpool: NULL-check json_get_value_for_key inputs and outputs in watchdo Taiki Koshino <koshino@sraoss.co.jp>

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