[MDEV-32501] INFORMATION_SCHEMA.KEY_PERIOD_USAGE reveals information to unprivileged user Created: 2023-10-17 Updated: 2024-01-15 |
|
| Status: | In Testing |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Information Schema |
| Affects Version/s: | N/A |
| Fix Version/s: | 11.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Nikita Malyavin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
The general problem isn't new, see
Since the user isn't allowed to see the table structure or any columns involved into the period, I would expect both queries to return empty set. |
| Comments |
| Comment by Nikita Malyavin [ 2024-01-01 ] |
|
The rule I was following in the implementations is "we show the record if the user has privileges on any table column" so the behavior seems correct to me. The case for PERIODS is covered by current tests. I guess it's also ok to see the constraint name if we can see at least one column or period of the constraint. |
| Comment by Elena Stepanova [ 2024-01-01 ] |
|
This needs to be confirmed by serg, as the reasoning "the implementation follows certain logic, hence the logic is correct" isn't in itself sufficient. |
| Comment by Sergei Golubchik [ 2024-01-01 ] |
|
period is ok. It should show the period name if the user has any privilege on any of the table columns. According to the standard it should only show start/end columns to the schema owner, but as we don't have that, let's say any privilege on these columns is enough. key_period_usage is not ok. It should only show something when a user has any non-SELECT privilege on any of the table columns. |
| Comment by Nikita Malyavin [ 2024-01-04 ] |
|
please review commit f39fce87a4d link |
| Comment by Nikita Malyavin [ 2024-01-05 ] |
|
some tests are failing yet |
| Comment by Nikita Malyavin [ 2024-01-08 ] |
|
please review commit 3459e69 |
| Comment by Sergei Golubchik [ 2024-01-09 ] |
|
3459e69 is ok to push |