Skip to content
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

release-19.2: sql: prevent arbitrary writes to system.comments #46833

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

knz
Copy link
Contributor

@knz knz commented Apr 1, 2020

Backport 1/1 commits from #45712.

/cc @cockroachdb/release


Fixes #45707.

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.
@knz knz requested a review from RichardJCai April 1, 2020 08:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz merged commit 9bb5d3c into cockroachdb:release-19.2 Apr 3, 2020
@knz knz deleted the backport19.2-45712 branch April 3, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants