Re: [HACKERS] Letting the client choose the protocol to use during a SASL exchange - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Letting the client choose the protocol to use during a SASL exchange
Date
Msg-id 6311.1491509132@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Letting the client choose the protocol to use during aSASL exchange  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: [HACKERS] Letting the client choose the protocol to use during aSASL exchange  (Álvaro Hernández Tortosa <aht@8kdata.com>)
Re: [HACKERS] Letting the client choose the protocol to use during aSASL exchange  (Simon Riggs <simon@2ndquadrant.com>)
Re: [HACKERS] Letting the client choose the protocol to use during aSASL exchange  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> How would we provide the list of protocols? Surely the protocol is
> defined by pg_hba.conf, which makes it dependent upon username,
> database and ip range. If the list were accurate, it would allow an
> attacker to discover how best to attack. If the list were inaccurate
> it would just be an annoyance.

> At minimum, providing the list of protocols means an extra round trip
> to the server.

Yeah, that's a problem.

> ISTM that if you have a valid role to connect to then you'll also know
> what authentication mechanism to use so you should be able to specify
> the mechanism in your connection message and save the extra trip.

I do not buy that in the least.  It has never been the case before now
that clients know in advance what the auth challenge method will be.
If we put that requirement on them for SCRAM, we're just going to be
exporting a lot of pain and end-user-visible inconsistency.

Perhaps we could turn this around: have the client send (in the connection
request packet) a list of auth protocols it thinks it is able to handle.
(I'm envisioning this as being more or less fixed for any one version of
any one client, since it would basically mean "I have code to do X, Y, or
Z".)  Then the server can pick one that is allowed by pg_hba.conf, or it
can just ignore the list and send what it wants anyway, probably leading
to client disconnect.

We could avoid this being a protocol break by having the server's default
assumption being that the client can handle all pre-SCRAM auth protocols.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [HACKERS] Letting the client choose the protocol to use during aSASL exchange
Next
From: Rod Taylor
Date:
Subject: [HACKERS] Row Level Security UPDATE Confusion