sql: prevent arbitrary writes to system.comments#45712
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Mar 5, 2020
Merged
sql: prevent arbitrary writes to system.comments#45712craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
Contributor
Author
|
Note that postgres allows users to bypass privileges to view comments from any object, this is also allowed by crdb and remains unchanged here. |
f686b07 to
09ffbe8
Compare
RichardJCai
approved these changes
Mar 4, 2020
Contributor
RichardJCai
left a comment
There was a problem hiding this comment.
LGTM
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @RichardJCai)
RichardJCai
reviewed
Mar 4, 2020
Contributor
RichardJCai
left a comment
There was a problem hiding this comment.
Oops, forgot to add - current changes look good to me, should be okay once the failing logic tests are updated.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)
Previously, the GRANT, UPDATE, DELETE and INSERT privileges were granted to `public`, i.e. everyone, on `system.comments`. This was unintended - only users with permissions on an object should be able to modify that object's comments. This patch fixes it. Release note (security update): Any user could previously modify any database/table/view/index comment via direct SQL updates to `system.comments`. This was unintended and a form of privilege escalation, and is now prevented. The privileges required for the COMMENT statement and `pg_description`, `col_description()`, `obj_description()` and `shobj_description()` are operating as in PostgreSQL and unaffected by this change: all users can *view* any comments on any object (bypassing other privileges), but modifying comments require write privilege on the target object.
Contributor
Author
|
Thanks! bors r=RichardJCai |
Contributor
Build failed (retrying...) |
Contributor
Build succeeded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45707.
Previously, the GRANT, UPDATE, DELETE and INSERT privileges
were granted to
public, i.e. everyone, onsystem.comments.This was unintended - only users with permissions on an object
should be able to modify that object's comments.
This patch fixes it.
Release note (security update): Any user could previously modify any
database/table/view/index comment via direct SQL updates to
system.comments. This was unintended and a form of privilegeescalation, and is now prevented. The privileges required for the
COMMENT statement and
pg_description,col_description(),obj_description()andshobj_description()are operating asin PostgreSQL and unaffected by this change: all users can view any
comments on any object (bypassing other privileges), but modifying
comments require write privilege on the target object.