Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40056

Analyze Galera Dynamic Variables Susceptible to RCEs

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Hide
      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_node_address, which can be modified at runtime, were not properly sanitized when used to construct a shell command
      Show
      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_node_address, which can be modified at runtime, were not properly sanitized when used to construct a shell command
    • Q3/2026 Replic. Maintenance

    Description

      MDEV-40027 reported one dynamic variable vulnerable to command injection on the donor node during State Snapshot Transfer (SST) operations. The pattern is general though, and other variables are likely affected. We need to analyze all dynamic variables & their usage in SST scripts to find which are affected.

      Dynamic variables that reach the bash scripts

      Variable Becomes (shell var) Via Consumed in scripts
      wsrep_sst_method script name wsrep_sst_<method> command name in all builders selects which of the four scripts runs
      wsrep_sst_auth WSREP_SST_OPT_AUTH → split into WSREP_SST_OPT_USER / WSREP_SST_OPT_PSWD WSREP_SST_AUTH_ENV env common.sh (split L1063-1083), mariabackup.sh, mysqldump.sh
      wsrep_sst_receive_address WSREP_SST_OPT_ADDR → HOST/PORT/MODULE/LSN/PATH joiner --address common.sh (parse L229-307), rsync.sh, mariabackup.sh, mysqldump.sh
      wsrep_node_address WSREP_SST_OPT_ADDR (same as above, joiner fallback when receive-address is AUTO) joiner --address common.sh, rsync.sh, mariabackup.sh, mysqldump.sh
      wsrep_gtid_domain_id WSREP_SST_OPT_GTID_DOMAIN_ID --gtid-domain-id %d common.sh (L436), mariabackup.sh, mysqldump.sh (numeric)

      Injection-relevant subset (string-valued, attacker-influenced text)

      • wsrep_sst_method — validated filename_char ✅
      • wsrep_sst_auth — validated shell_char ✅ (MDEV-40027)
      • wsrep_sst_receive_address — validated address_char ✅
      • wsrep_node_address — length-only, NOT charset-validated ❌ (the open gap; reaches joiner --address '%s' in the popen string)
      • wsrep_gtid_domain_id is an integer sysvar, so not a text-injection vector.

      Attachments

        Issue Links

          Activity

            People

              janlindstrom Jan Lindström
              bnestere Brandon Nesterenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 5d
                  5d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1d 5.5h Time Not Required
                  1d 5.5h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.