Skip to content

set session_states may walk around the privilege check to set resource group #59600

@djshow832

Description

@djshow832

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

connection default;
CREATE USER no_resource_group;
CREATE RESOURCE GROUP test RU_PER_SEC = 666;
GRANT RESOURCE_GROUP_USER ON *.* TO resource_group_user;

connect (no_resource_group,localhost,no_resource_group,,);
SET SESSION_STATES "{'rs-group':'test'}";
SELECT CURRENT_RESOURCE_GROUP();

2. What did you expect to see? (Required)

SELECT CURRENT_RESOURCE_GROUP();
default

3. What did you see instead (Required)

SELECT CURRENT_RESOURCE_GROUP();
test

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions