Re: Emptying oauth_validator_libraries doesn't stop OAuth logins

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Subject: Re: Emptying oauth_validator_libraries doesn't stop OAuth logins
Date: 2026-11-03 18:06:10
Message-ID: 27322352-1871-4B0B-8361-A0E52FD8F713@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 10 Oct 2026, at 11:57, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:

Sorry for being slow to get to this, working through the backlog of bugs in the
inbox now.

> The attached patch calls check_oauth_validator() again in
> oauth_init(), before loading the library, and fails the authentication
> if the validator isn't permitted anymore. Only logins on affected
> oauth lines fail, everything else keeps working with the old HBA lines
> as before.

Thanks for the patch, I agree that the current behaviour is incorrect wrt the
docs and we should fix this down to v18.

+ if (!check_oauth_validator(port->hba, LOG, &err_msg))
+ ereport(ERROR,

Since check_oauth_validator already performs error logging, why not let it
handle erroring out with a higher elevel than LOG? Also, we should be using
COMMERROR here to keep details from bleeding through during authentication.
The attached v2 implements this, thoughts on that?

Another option would be a larger refactoring to move this re-checking into
load_validator_library() to make sure it cannot bypass due to programmer error,
but for a backpatchable fix I think the current approach is better.

--
Daniel Gustafsson

Attachment Content-Type Size
v2-0001-oauth-Recheck-oauth_validator_libraries-during-au.patch application/octet-stream 2.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-11-03 21:36:04 Re: nbtree: opt-in leaf key prefix compression
Previous Message Greg Burd 2026-11-03 17:48:41 Re: nbtree: opt-in leaf key prefix compression