Rule ID
SV-289289r1319205_rule
Version
V1R1
CCIs
If passwords are used for authentication, storing weak or insufficiently hardened password representations increases the risk of offline credential compromise. Password verifiers must be salted and transformed using approved, policy-compliant mechanisms that resist brute-force and dictionary attacks. MySQL Database Server 9.x adds stronger password transformation options. Where available and required by policy, locally managed passwords should be stored using the stronger PBKDF2 with SHA-512 format rather than relying only on the legacy CRYPT5 with SHA-256 behavior. The server's serialized representation identifies the transformation used, allowing auditors to verify whether stronger password storage is in use.
Review the system documentation to determine which accounts use passwords managed internally by MySQL.
Review locally managed MySQL accounts and their authentication plugins:
SELECT User, Host, plugin, authentication_string
FROM mysql.user
WHERE plugin IN ('caching_sha2_password', 'sha256_password');
MySQL stores internally managed credentials in the mysql.user table. For "caching_sha2_password", the password is transformed before it is stored in the "authentication_string" column.
Verify the configured password storage settings:
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.global_variables
WHERE VARIABLE_NAME IN
(
'caching_sha2_password_storage_format',
'caching_sha2_password_enforce_storage_format',
'caching_sha2_password_digest_rounds'
);
For MySQL 9.7, "caching_sha2_password" supports the following password storage formats:
- CRYPT5 using SHA-256.
- PBKDF2_SHA512 using PBKDF2 with SHA-512.
If the organization requires PBKDF2 with SHA-512, verify "caching_sha2_password_storage_format" is set to "PBKDF2_SHA512".
If organizational policy requires the configured storage format to be enforced for all "caching_sha2_password" accounts, verify "caching_sha2_password_enforce_storage_format" is enabled. When enforcement is enabled, an account using a different storage format is forced to change its password so it can be stored using the configured format.
Verify that locally managed password accounts do not contain clear-text passwords or passwords stored using an authentication mechanism that does not provide the required one-way salted transformation.
If locally managed passwords are stored in clear text, reversibly encrypted form, or without the required salted one-way password transformation, this is a finding.
If organizational policy requires PBKDF2_SHA512 and the server is not configured to use and, where required, enforce that storage format, this is a finding.Configure MySQL 9.x to store locally managed passwords only as approved salted one-way transformations. Where available and required by policy, configure the server to use the PBKDF2 with SHA-512 password storage format rather than the legacy CRYPT5 with SHA-256 format. Configure the password rounds or iteration control to meet the organization-defined minimum and restrict the ability to change that setting to authorized administrators only. Reset or rotate passwords for accounts still stored using the legacy representation so the credentials are regenerated using the approved format. Remove or disable any mechanisms that store passwords in clear text, reversibly encrypted form, or other nonapproved formats.