Bug #119766 Rows unexpectedly added in performance_schema for failed connections

Submitted: 23 Jan 19:18
Reporter: Aaron Newberg Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S2 (Serious)
Version:8.0.44 OS:Any
Assigned to: CPU Architecture:Any

[23 Jan 19:18] Aaron Newberg
Description:
Starting in 8.0.44, failed connection attempts add a row to performance_schema.accounts, performance_schema.users, and others.

Rows should only be added when authentication succeeds.

For example, in performance_schema.accounts:
When authentication fails, we expect the table with NULL for USER and HOST to be updated.
See documentation:
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-accounts-table.html#:~:text=for...

However, starting in 8.0.44, a new row is created for failed connection attempts.

If many failed connection attempts are issued from unique users (that may or may not exist), performance_schema can become bloated and use more memory than it should.

How to repeat:
1. Enable performance_schema and restart
2. Try to connect to MySQL as a user that does not exist (FYI anonymous user ''@'%' must not be present)
3. 'select * performance_schema.accounts' and observe the row created for the user from step 2

Suggested fix:
Revert https://github.com/mysql/mysql-server/commit/a7ad97839cfb2302fe5985fd5964bb4301d62bbf#diff...

The change in sql_authentication.cc runs the PSI instrumentation code for all connection attempts.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.