Skip to content

MDEV-40027 : Galera Cluster-peer > Donor command execution#5234

Open
janlindstrom wants to merge 2 commits into
MariaDB:10.6from
mariadb-corporation:10.6-MDEV-40027
Open

MDEV-40027 : Galera Cluster-peer > Donor command execution#5234
janlindstrom wants to merge 2 commits into
MariaDB:10.6from
mariadb-corporation:10.6-MDEV-40027

Conversation

@janlindstrom

Copy link
Copy Markdown
Contributor

An appropriately privileged user (with SUPER privileges) could execute shell commands as the uid of the mariadbd process because the values of the system variable wsrep_sst_auth, which can be modified at runtime, were not properly sanitized when used to construct a shell command.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces input validation for the wsrep_sst_auth variable to prevent shell injection, along with corresponding test cases. However, several issues were identified in the review: the shell_char function uses a blacklist approach that is vulnerable to command injection and should be replaced with a strict whitelist; the safe function in the mariabackup script is incorrectly passed the variable name instead of its value; and multiple temporary debug logs (JAN:JAN) need to be removed before merging.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread sql/wsrep_sst.cc Outdated
Comment thread scripts/wsrep_sst_mariabackup.sh
Comment thread sql/wsrep_sst.cc Outdated
Comment thread sql/wsrep_sst.cc Outdated
Comment thread sql/wsrep_sst.cc Outdated
@janlindstrom janlindstrom force-pushed the 10.6-MDEV-40027 branch 2 times, most recently from 6599821 to c03f58c Compare June 16, 2026 08:15
@janlindstrom janlindstrom requested review from hemantdangi-gc and removed request for temeo June 16, 2026 12:59
Comment thread sql/wsrep_sst.cc Outdated
Comment thread sql/wsrep_sst.cc Outdated
Comment thread sql/wsrep_sst.cc Outdated
Comment thread sql/wsrep_sst.cc Outdated
@janlindstrom janlindstrom self-assigned this Jun 17, 2026
@janlindstrom janlindstrom force-pushed the 10.6-MDEV-40027 branch 2 times, most recently from 7312085 to d53a22a Compare June 17, 2026 06:56

@hemantdangi-gc hemantdangi-gc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

An appropriately privileged user (with SUPER privileges) could
execute shell commands as the uid of the mariadbd process
because the values of the system variable wsrep_sst_auth,
which can be modified at runtime, were not properly
sanitized when used to construct a shell command.

Combined rsync and mariabackup test cases and added
test case for incorrect values for wsrep_sst_auth.
Fix potential issue with wsrep_node_address by allowing
only correctly constructed address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants