You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the active developments! I'm testing the permission behaviors of TiDB database for production use and found the issue that users can also get the names of tables that are not allowed. Please let me know if it's the expected result or not.
1. Minimal reproduce step (Required)
# 1. prepare
# mysql -h 127.0.0.1 -u root -P 4000
MySQL [(none)]> CREATE DATABASE secret;
MySQL [(none)]> CREATE TABLE `secret`.`secret_table` (id int);
MySQL [(none)]> CREATE USER test_user IDENTIFIED BY 'pass'; -- *doesn't have the privilege to access `secret`.`secret_table`*
# 2. check whether the user can get the name of the unpermitted table or not
# mysql -h 127.0.0.1 -u test_user -P 4000 -ppass
# The table must be invisible to the user. The following result is OK.
MySQL [(none)]> SELECT * FROM `INFORMATION_SCHEMA`.`TABLES` WHERE TABLE_SCHEMA = 'secret';
Empty set (0.09 sec)
# But, the user can see the table name using `INFORMATION_SCHEMA`.`TIKV_REGION_STATUS`.
MySQL [(none)]> SELECT * FROM `INFORMATION_SCHEMA`.`TIKV_REGION_STATUS` WHERE DB_NAME = 'secret';
+-----------+--------------------------------------+---------+----------+---------+--------------+----------+----------+------------+----------------+---------------+---------------+------------+------------------+------------------+-------------------------+---------------------------+
| REGION_ID | START_KEY | END_KEY | TABLE_ID | DB_NAME | TABLE_NAME | IS_INDEX | INDEX_ID | INDEX_NAME | EPOCH_CONF_VER | EPOCH_VERSION | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE | APPROXIMATE_KEYS | REPLICATIONSTATUS_STATE | REPLICATIONSTATUS_STATEID |
+-----------+--------------------------------------+---------+----------+---------+--------------+----------+----------+------------+----------------+---------------+---------------+------------+------------------+------------------+-------------------------+---------------------------+
| 15001 | 748000000000000EFFA900000000000000F8 | | 3753 | secret | secret_table | 0 | NULL | NULL | 5 | 1587 | 0 | 0 | 1 | 0 | NULL | NULL |
+-----------+--------------------------------------+---------+----------+---------+--------------+----------+----------+------------+----------------+---------------+---------------+------------+------------------+------------------+-------------------------+---------------------------+
1 row in set (0.05 sec)
2. What did you expect to see? (Required)
My expectation was it returns the empty set.
MySQL [(none)]> SELECT * FROM `INFORMATION_SCHEMA`.`TIKV_REGION_STATUS` WHERE DB_NAME = 'secret';
Empty set (0.09 sec)
I expected that TiDB adapts MySQL's following behavior even if the user accesses the tables in INFORMATION_SCHEMA which are only supported in TiDB.
For most INFORMATION_SCHEMA tables, each MySQL user has the right to access them, but can see only the rows in the tables that correspond to objects for which the user has the proper access privileges.
Since I didn't check other tables in INFORMATION_SCHEMA yet, there might be same issues.
Bug Report
Thanks for the active developments! I'm testing the permission behaviors of TiDB database for production use and found the issue that users can also get the names of tables that are not allowed. Please let me know if it's the expected result or not.
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
My expectation was it returns the empty set.
I expected that TiDB adapts MySQL's following behavior even if the user accesses the tables in
INFORMATION_SCHEMA
which are only supported in TiDB.Since I didn't check other tables in
INFORMATION_SCHEMA
yet, there might be same issues.3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: