-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
EXECUTE Grant is not required to execute functions #103842
Comments
For those concerned about access to underlying table data, the function does respect SELECT grant. Example here:
|
@data-matt The example you posted behaves identically to Postgres. I'll try to come up with a working reproduction of the issue. |
Probably because of this:
As part of this fix, we should also add an explicit grant to Here's a repro in PG:
|
I just realized that backporting the fix to enforce EXECUTE privileges is going to be disruptive. Since we weren't giving |
I think this also means that we should write an upgrade step that does |
107317: sql: functions have EXECUTE priv for public by default r=rafiss a=rafiss This uses the default privilege infrastructure in a similar way to how the USAGE privilege for types is given to `public` by default. This also fixes a display bug that was preventing the ALL privileges that are given to root and admin from being shown in SHOW. informs #103842 A complete fix for that issue may also require an upgrade migration to give existing functions the EXECUTE privilege for public. Release note (sql change): The public pseudo-role now receives the EXECUTE privilege by default for all user-defined functions that are created. This can be adjusted by using ALTER DEFAULT PRIVILEGES. Co-authored-by: Rafi Shamim <[email protected]>
Should we just not backport?
Is this something the foundations team can do? |
Informs cockroachdb#103842 Release note (bug fix): A bug has been fixed that allowed users to execute a user-defined function without having EXECUTE privileges on the function. This bug has been present since version 22.2 when UDFs were introduced.
EXECUTE privileges are now correctly checked for each user-defined function referenced in a query. Informs cockroachdb#103842 Release note (bug fix): A bug has been fixed that allowed users to execute a user-defined function without having EXECUTE privileges on the function. This bug has been present since version 22.2 when UDFs were introduced.
EXECUTE privileges are now correctly checked for each user-defined function referenced in a query. Informs cockroachdb#103842 Release note (bug fix): A bug has been fixed that allowed users to execute a user-defined function without having EXECUTE privileges on the function. This bug has been present since version 22.2 when UDFs were introduced.
EXECUTE privileges are now correctly checked for each user-defined function referenced in a query. Informs cockroachdb#103842 Release note (bug fix): A bug has been fixed that allowed users to execute a user-defined function without having EXECUTE privileges on the function. This bug has been present since version 22.2 when UDFs were introduced.
107587: sql: fix EXECUTE privileges for UDFs r=mgartner a=mgartner #### sql: fix EXECUTE privileges for UDFs Informs #103842 Release note (bug fix): A bug has been fixed that allowed users to execute a user-defined function without having EXECUTE privileges on the function. This bug has been present since version 22.2 when UDFs were introduced. #### upgrades: adds upgrade granting EXECUTE to public role for all functions This commit adds an upgrade that grants EXECUTE privileges to the public role for all existing functions. This matches the behavior of `CREATE FUNCTION` which automatically adds this privilege as of #107317. Release note: None #### catpb: document `UserPrivilege.WithGrantOption` Release note: None 110866: tenantrate: update default rate_limit to -400 r=andy-kimball a=andy-kimball Previously, the default tenant rate limit was a relative value of -200, meaning that a single tenant is allowed to use up to ~20% of a KV node's CPU. This change updates that to -400, because experience has shown that it provides better tenant burst performance while still providing sufficiently predictable performance, given today's host cluster sizes and utilization. Fixes: https://cockroachlabs.atlassian.net/browse/CC-25687 Release note: None 110910: storage: limit number of replicated lock conflicts returned by mutations r=nvanbenschoten a=nvanbenschoten Closes #110902. This commit limits the number of replicated lock conflicts returned by locking and mutation operations during evaluation to the value of the `storage.mvcc.max_conflicts_per_lock_conflict_error` cluster setting. Release note: None Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Andrew Kimball <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
I believe this is now completed. The fixes are far too invasive to backport, unfortunately. |
Describe the problem
EXECUTE Grant is not required to run an UDF.
To Reproduce
Expected behavior
Users can only use the function when granted/they have the privilege/they have inherited the privilege or they are the owner.
Afflicted versions 22.2+ (Please backport).
Jira issue: CRDB-28228
The text was updated successfully, but these errors were encountered: