MDEV-38601 require FEDERATED ADMIN for SHOW CREATE SERVER - #4743
Merged
gkodinov merged 1 commit intoMar 25, 2026
Conversation
gkodinov
requested changes
Mar 6, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
In addition to the below, please make sure your commit has a commit message complying with CODING_STANDARDS.md.
mariadb-YuchenPei
self-requested a review
March 10, 2026 00:14
mariadb-YuchenPei
requested changes
Mar 13, 2026
MooSayed1
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 18, 2026 18:08
cb14e9d to
2b8feba
Compare
Contributor
Author
|
@gkodinov @mariadb-YuchenPei Thank you for the review and srry for the delay was focusing at proposal and other stuff. |
mariadb-YuchenPei
approved these changes
Mar 18, 2026
mariadb-YuchenPei
left a comment
Contributor
There was a problem hiding this comment.
Looks good now. Passing to @vuvova for a final review.
MooSayed1
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 19, 2026 00:02
2b8feba to
069640d
Compare
vuvova
requested changes
Mar 22, 2026
MooSayed1
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 23, 2026 01:33
069640d to
7626422
Compare
vuvova
approved these changes
Mar 23, 2026
vuvova
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 23, 2026 20:18
7626422 to
ed340dc
Compare
gkodinov
requested changes
Mar 24, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Please add a commit message to your commit!
MooSayed1
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 24, 2026 14:20
ed340dc to
894d823
Compare
Contributor
Author
|
@gkodinov Done. Thank you all for your effort in reviewing and guiding. |
gkodinov
approved these changes
Mar 25, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you for your work on this!
SHOW CREATE SERVER was accessible to any user with a global privilege, without requiring FEDERATED ADMIN. Add a privilege check before mysql_show_create_server() so that only users with FEDERATED ADMIN can view server definitions.
gkodinov
force-pushed
the
MDEV-38601-show-create-server-priv
branch
from
March 25, 2026 08:29
894d823 to
911ad7e
Compare
gkodinov
enabled auto-merge (rebase)
March 25, 2026 08:29
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.
The Jira issue number for this PR is: MDEV-38601
Description
SHOW CREATE SERVERdid not require any privilege — any authenticated usercould run it and see full server connection details including passwords stored
in
mysql.servers.CREATE SERVER,ALTER SERVER, andDROP SERVERall correctly requireFEDERATED ADMINprivilege, butSHOW CREATE SERVER(introduced in MDEV-15696,MariaDB 11.7) was missing the equivalent check.
The root cause is in
sql/sql_parse.cc: theSQLCOM_SHOW_CREATE_SERVERcasehad no
check_global_access()call before dispatching tomysql_show_create_server().The fix: add
check_global_access(thd, PRIV_STMT_CREATE_SERVER)at the topof the
SQLCOM_SHOW_CREATE_SERVERcase, matching the identical pattern usedby
SQLCOM_CREATE_SERVER,SQLCOM_ALTER_SERVER, andSQLCOM_DROP_SERVER.Release Notes
SHOW CREATE SERVERnow requires theFEDERATED ADMINprivilege.Users without this privilege receive
ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s).How can this PR be tested?
The test creates a server as root, then verifies that an unprivileged user
receives
ER_SPECIFIC_ACCESS_DENIED_ERRORonSHOW CREATE SERVER, and thatthe same user succeeds after being granted
FEDERATED ADMIN.Basing the PR against the correct MariaDB version
This is a bug fix.
SHOW CREATE SERVERwas introduced in 11.7, and theearliest affected maintained branch is 11.8, so this PR targets
upstream/11.8.PR quality check