[MDEV-19088] SUPER is not required for ALTER FUNCTION when log_bin_trust_function_creators=OFF and log_bin=ON Created: 2019-03-29 Updated: 2023-12-04 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Data Definition - Procedure, PL/SQL, Stored routines |
| Affects Version/s: | 10.1.38 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
The documentation says that SUPER should be required for ALTER FUNCTION when log_bin_trust_function_creators=OFF and log_bin=ON: https://mariadb.com/kb/en/library/alter-function/ https://mariadb.com/kb/en/library/binary-logging-of-stored-routines/ But a quick test shows that this is not the case. For example, if I create a function as a user with SUPER:
And then create a user with the ALTER ROUTINE privilege, but without SUPER:
And then ensure that both log_bin_trust_function_creators=OFF and log_bin=ON:
You would think that this user would not be able to alter the function. But a test shows that the user can:
Code analysis shows that the Sp_handler::sp_update_routine does not check SUPER_ACL like Sp_handler::sp_create_routine does. sp_create_routine check: https://github.com/MariaDB/server/blob/8cf7e3459d7309ce122824146260c4aecfa6ca77/sql/sp.cc#L1397 sp_update_routine check: https://github.com/MariaDB/server/blob/8cf7e3459d7309ce122824146260c4aecfa6ca77/sql/sp.cc#L1632 |