-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: recognize client-supplied hashes in WITH PASSWORD like pg #50757
Copy link
Copy link
Closed
Labels
A-authenticationPertains to authn subsystemsPertains to authn subsystemsA-cc-enablementPertains to current CC production issues or short-term projectsPertains to current CC production issues or short-term projectsA-securityA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-pgwirepgwire protocol issues.pgwire protocol issues.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)P-1Issues/test failures with a fix SLA of 1 monthIssues/test failures with a fix SLA of 1 monthT-server-and-securityDB Server & SecurityDB Server & SecurityX-server-triaged-202105
Metadata
Metadata
Assignees
Labels
A-authenticationPertains to authn subsystemsPertains to authn subsystemsA-cc-enablementPertains to current CC production issues or short-term projectsPertains to current CC production issues or short-term projectsA-securityA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-pgwirepgwire protocol issues.pgwire protocol issues.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)P-1Issues/test failures with a fix SLA of 1 monthIssues/test failures with a fix SLA of 1 monthT-server-and-securityDB Server & SecurityDB Server & SecurityX-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