-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users with only Insert privilege can perform REPLACE
on that table
#23909
Comments
|
/component privilege |
I think it is technically a different issue with
|
changing these lines tidb/planner/core/planbuilder.go Lines 2474 to 2475 in 3d8084e
to include the addition privileges when not sure about |
Would you like to file a PR? @kennytm |
The bug report actually says
So even if I write
that bug report is about column-level privileges (#9766) which we don't support yet. So we can just always require INSERT + UPDATE privileges in case of |
+1. I recently fixed a bug with |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Privilege check is not strict enough.
Users with only INSERT privilege on a table can perform REPLACE or INSERT ON DUPLICATE KEY UPDATE, allowing them to override existing data.
None.
[v3.0.0:v3.0.20], [v4.0.0:v4.0.12], [v5.0.0:v5.0.0]
v4.0.13, v5.0.1 |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
As root:
As user
rrrr
:2. What did you expect to see? (Required)
User
rrrr
should not be able to execute the REPLACE:3. What did you see instead (Required)
The REPLACE completed successfully:
The row is indeed replaced:
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: