sql: recognize client-supplied hashes in WITH PASSWORD like pg #50757
Labels
A-authentication
Pertains to authn subsystems
A-cc-enablement
Pertains to current CC production issues or short-term projects
A-security
A-sql-pgcompat
Semantic compatibility with PostgreSQL
A-sql-pgwire
pgwire protocol issues.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-server-and-security
DB Server & Security
X-server-triaged-202105
CockroachDB currently requires the server to learn about the cleartext password of a SQL user when the password is stored (either in CREATE USER WITH PASSWORD, or ALTER USER WITH PASSWORD).
This is a security problem, and has been deprecated in PostgreSQL since v9.6 (released 2016).
The correct best practice is to have the client negotiate the password, then only provide the server with a hash/fingerprint that is sufficient to validate authentication when clients connect.
The way this works is the following:
md5:
prefix)scram-sha-256:
prefix and 5 parameter/hash fields)We may not wish to support MD5 auth at all in CockroachDB because it's considered obsolete (and MD5-based authn is vulnerable to various attacks already). However, perhaps it could be provided as a compatibility opt-in for legacy applications that require it.
SCRAM authn, on the other hand, is very much a thing. That particular project is tracked in #42519.
Epic CRDB-5349
The text was updated successfully, but these errors were encountered: