Type:
New Feature
Priority:
Critical
Resolution:
Fixed
New auth plugin:
uses KDF (try to use what openssl provides)
salted
uses server- and client-side scrambles
set as default auth plugin
ed25519 based? (or try to use what openssl provides)
support old hashes?
reduce roundtrips:
set as default (MDEV-12320 )
allow clients to provide the salt (--plugin-salt=XXX)
if it's incorrect — connection fails.
PASSWORD() returns the salt in a Note
Password generation and storage
the KDF function is pbkdf2 (supported by everything, including windows native , Java, javascript, PHP, .NET
parameters to the pbkdf2 are stored in with authentication plugin data : hash function (SHA512,SHA256), iteration count, salt, key_length, together with derived key = PBKDF2(func, password, salt, iteration_count, key_length)
number of iterations is a power of 2, greater than 9
the algorithm is ed25519, "hash" is the public key generated using ed25519 from the PBKDF2(password)
The authentication string, stored by the server, is
concat( 'P' , conv(log2(iterations)-10, 10, 62), ':' , base64(salt), ':' , base64(hash))
that e.g. P0:WW9sXaaL/o:vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI
it consists of colon-separated fields
first field is 'P' (denotes KDF algorithm = PBKDF2) and the number of iterations, '0' means 1024, '1' means 2048, etc
then salt
then the password hash
Let's call everything except the password hash the ext-salt , in the example above it's P0:WW9sXaaL/o
Login process, packet exchange
1. Server sends the welcome packet with a 32-byte random scramble
2 . if the ext-salt was specified in the .my.cnf, the client skips to step 4, otherwise it sends the user name (and nothing else) to the server
3. Server sends the ext-salt to the client
4. Client sends the random 32-byte scramble, and the concat(server scramble, client scramble) ed25519-signed by a secret key generated from the PBKDF2(password, ext-salt)
5. Server replies with "ok" or "acces denied"
Rough idea
the KDF function is pbkdf2 (supported by everything, including windows native , Java, javascript, PHP, .NET
parameters to the pbkdf2 are stored in with authentication plugin data : hash function (SHA512,SHA256), interation count, salt, key_length, together with derived key = PBKDF2(func, password, oalt, iteration_count, key_length)
Login process, packet exchange
1. Server sends ServerPluginParameters message with hash function, interation count, salt, key_length.
This is the only unencrypted message during entire exchange
2 . Client computes derived key from password and parameters:
derived_key= PBKDF2(hash_func, password, salt, iteration_count, key_length)
Client sends ServerVerificationChallenge = AES_ENCRYPT(client_scramble,derived_key) to server
3. server decrypts ServerVerificationChallenge and sends
ServerVerificationResponse = AES_ENCRYPT(concat(server_scramble,client_scramble)), derived_key))
4. client verifies AES_DECRYPT(ServerVerificationResponse, derived_key) =concat(server_scramble,client_scramble).
If they don't match, client could not verify the server, and error is reported.
Client still has to prove it has the password, not just the derived key
So it sends
ClientEncryptedPassword message = AES_ENCRYPT(concat(hash_func(password),server_scramble,client_scramble)),derived_key)
5. Server verifies the client
a) tmp = AES_DECRYPT(ClientEncryptedPassword. derived_key)
b) hashed_password=substr(tmp, hash_length)
c) derived_key2 = PBKDF2(hash_func, hashed_password, salt, iteration_count, key_length)
and compares derived_key and derived_key2 for equality, (due to the HMAC_collisions property of pbkdf2 , password and hash_func(password) would produce the same keys)
Server sends OK or ERR packet
{"report":{"fcp":1643.6000001430511,"ttfb":422,"pageVisibility":"visible","entityId":126073,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"27e7b185-5188-42d9-bfc4-e3751770d4e6","navigationType":0,"readyForUser":1796.7000000476837,"redirectCount":0,"resourceLoadedEnd":2102.5,"resourceLoadedStart":431.30000019073486,"resourceTiming":[{"duration":446.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":431.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":431.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":878,"responseStart":0,"secureConnectionStart":0},{"duration":621.8999998569489,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":431.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":431.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.5,"responseStart":0,"secureConnectionStart":0},{"duration":631.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":431.80000019073486,"connectEnd":431.80000019073486,"connectStart":431.80000019073486,"domainLookupEnd":431.80000019073486,"domainLookupStart":431.80000019073486,"fetchStart":431.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":431.80000019073486,"responseEnd":1062.9000000953674,"responseStart":1062.9000000953674,"secureConnectionStart":431.80000019073486},{"duration":689.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":432,"connectEnd":432,"connectStart":432,"domainLookupEnd":432,"domainLookupStart":432,"fetchStart":432,"redirectEnd":0,"redirectStart":0,"requestStart":432,"responseEnd":1121.2000000476837,"responseStart":1121.2000000476837,"secureConnectionStart":432},{"duration":720.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":432.2000000476837,"connectEnd":432.2000000476837,"connectStart":432.2000000476837,"domainLookupEnd":432.2000000476837,"domainLookupStart":432.2000000476837,"fetchStart":432.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":432.2000000476837,"responseEnd":1152.8000001907349,"responseStart":1152.8000001907349,"secureConnectionStart":432.2000000476837},{"duration":720.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":432.7000000476837,"connectEnd":432.7000000476837,"connectStart":432.7000000476837,"domainLookupEnd":432.7000000476837,"domainLookupStart":432.7000000476837,"fetchStart":432.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":432.7000000476837,"responseEnd":1153.2000000476837,"responseStart":1153.2000000476837,"secureConnectionStart":432.7000000476837},{"duration":725.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":433,"connectEnd":433,"connectStart":433,"domainLookupEnd":433,"domainLookupStart":433,"fetchStart":433,"redirectEnd":0,"redirectStart":0,"requestStart":433,"responseEnd":1158.6000001430511,"responseStart":1158.6000001430511,"secureConnectionStart":433},{"duration":797,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":433.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":433.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1230.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":726,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":433.40000009536743,"connectEnd":433.40000009536743,"connectStart":433.40000009536743,"domainLookupEnd":433.40000009536743,"domainLookupStart":433.40000009536743,"fetchStart":433.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":433.40000009536743,"responseEnd":1159.4000000953674,"responseStart":1159.4000000953674,"secureConnectionStart":433.40000009536743},{"duration":796.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":433.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":433.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1230.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":726.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":433.7000000476837,"connectEnd":433.7000000476837,"connectStart":433.7000000476837,"domainLookupEnd":433.7000000476837,"domainLookupStart":433.7000000476837,"fetchStart":433.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":433.7000000476837,"responseEnd":1160.3000001907349,"responseStart":1160.3000001907349,"secureConnectionStart":433.7000000476837},{"duration":950.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":441,"connectEnd":441,"connectStart":441,"domainLookupEnd":441,"domainLookupStart":441,"fetchStart":441,"redirectEnd":0,"redirectStart":0,"requestStart":441,"responseEnd":1391.3000001907349,"responseStart":1391.3000001907349,"secureConnectionStart":441},{"duration":1661.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":441,"connectEnd":441,"connectStart":441,"domainLookupEnd":441,"domainLookupStart":441,"fetchStart":441,"redirectEnd":0,"redirectStart":0,"requestStart":441,"responseEnd":2102.5,"responseStart":2102.5,"secureConnectionStart":441},{"duration":146.89999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1245.8000001907349,"connectEnd":1245.8000001907349,"connectStart":1245.8000001907349,"domainLookupEnd":1245.8000001907349,"domainLookupStart":1245.8000001907349,"fetchStart":1245.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1245.8000001907349,"responseEnd":1392.7000000476837,"responseStart":1392.7000000476837,"secureConnectionStart":1245.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":191,"responseStart":422,"responseEnd":432,"domLoading":429,"domInteractive":2148,"domContentLoadedEventStart":2148,"domContentLoadedEventEnd":2206,"domComplete":3050,"loadEventStart":3050,"loadEventEnd":3051,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2118.100000143051},{"name":"bigPipe.sidebar-id.end","time":2122.300000190735},{"name":"bigPipe.activity-panel-pipe-id.start","time":2122.600000143051},{"name":"bigPipe.activity-panel-pipe-id.end","time":2124.2000000476837},{"name":"activityTabFullyLoaded","time":2224.100000143051}],"measures":[],"correlationId":"3c8b74634db2b2","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":169,"dbReadsTimeInMs":62,"dbConnsTimeInMs":76,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}