/

CVE-2026-48165

Severity:

HIGH RISK

(8.0)

OS Command Injection (CWE-78) in MariaDB Galera SST

CVE-2026-48165

Modified

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution within the database server context

Severity:

HIGH RISK

(8.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

High-privileged MariaDB users can abuse Galera State Snapshot Transfer (SST) configuration variables to inject and execute arbitrary shell commands on a joiner node.

When these cluster variables are constructed from untrusted input and passed to the underlying shell without strict validation, an attacker can run commands as the MariaDB daemon user.

Affected context

This vulnerability arises in MariaDB deployments using Galera clustering where State Snapshot Transfer (SST) is configured and controlled via global system variables such as wsrep_sst_receive_address and wsrep_sst_donor.

The risk materializes when high-privileged database accounts can modify these variables and the SST mechanism subsequently uses their values to build shell-level commands on a joiner node.

Environments that rely on automated or dynamic configuration of cluster addresses without robust input constraints are particularly exposed.

Exploit preconditions

  • Attack surface: MariaDB SQL interface on a Galera cluster node where SST can be triggered.
  • Required access: High-privileged MariaDB account capable of setting global system variables (e.g., SUPER or equivalent administrative privileges).
  • Trigger point: Execution of Galera SST operations in which the values of wsrep_sst_receive_address or wsrep_sst_donor are consulted to build shell commands for snapshot transfer.
  • Why exploitation is possible: User-controlled values are incorporated into shell command strings without adequate sanitization or strict parameterization, allowing crafted data to break out of expected argument boundaries and introduce attacker-defined commands.

Why this happens

The underlying flaw is a classic OS command injection pattern, mapping to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

MariaDB's Galera SST mechanism appears to construct shell commands using configuration values from global system variables and executes them with the privileges of the MariaDB daemon user.

Because these variable values are not fully constrained to safe formats (e.g., strictly validated addresses or identifiers) and are instead treated as raw command fragments or arguments, special shell metacharacters and additional tokens can alter the command's structure.

This design couples configuration data directly with shell execution logic, breaking the separation between data and code and enabling arbitrary command execution in contexts where an attacker has sufficient database-level privileges.

Potential impact

  • Execution of arbitrary shell commands as the MariaDB daemon user on Galera joiner nodes.
  • Installation of backdoors, web shells, or persistence mechanisms on affected database servers.
  • Exfiltration, tampering, or destruction of database files and configuration data.
  • Lateral movement within the infrastructure using the database server as a pivot.
  • Disruption of cluster availability through destructive or resource-exhausting commands.

General mitigation guidance

Effective mitigation focuses on ensuring that configuration values cannot influence shell commands in an unsafe way and that privileged access is tightly controlled.

Recommended defensive patterns include:

  • Designing SST and similar subsystems to avoid direct shell invocation where possible, or to rely on fully parameterized execution APIs that never concatenate raw strings into commands.
  • Restricting global system variables used by cluster components to strictly validated formats (e.g., IP/host:port syntax) and rejecting any value containing shell metacharacters or unexpected characters.
  • Enforcing principle of least privilege for administrative database accounts, minimizing the number of roles that can modify SST-related global variables.
  • Isolating Galera nodes using network segmentation and tightening OS-level permissions and SELinux/AppArmor profiles so that the database daemon has limited ability to affect the broader system.
  • Incorporating security reviews for any feature that takes database-level configuration and passes it into external processes, ensuring a clear boundary between data and executable context.

How teams detect issues like this

Detection efforts can combine configuration review, audit logging, and code-level analysis:

  • Static analysis and code review: Look for code paths that:
  • Construct shell commands using values from global system variables or configuration tables.
  • Build command strings through concatenation or string formatting instead of parameterized execution functions.
  • Do not apply rigorous validation or normalization to configuration values before invoking external processes.
  • Configuration auditing: Regularly inspect wsrep_sst_receive_address, wsrep_sst_donor, and related variables for unusual content such as shell metacharacters, multiple commands, or non-standard address formats.
  • Behavioral monitoring: Monitor SST operations and system logs for anomalous command invocations, unexpected subprocess executions, or unusual network connections originating from MariaDB processes.
  • Policy enforcement and CI checks: Integrate automated checks in development pipelines to flag patterns where database configuration is passed to shell commands without validation, and use security linting tools that specialize in command construction and subprocess usage.

Sources

SourceLink
github.comgithub.com/MariaDB/server/security/advisories/GHSA-7v3p-h23x-8hwv
jira.mariadb.orgjira.mariadb.org/browse/MDEV-39676
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25143
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25145
access.redhat.comaccess.redhat.com/errata/RHSA-2026:33093
access.redhat.comaccess.redhat.com/errata/RHSA-2026:33412
access.redhat.comaccess.redhat.com/errata/RHSA-2026:33464
access.redhat.comaccess.redhat.com/errata/RHSA-2026:33481
access.redhat.comaccess.redhat.com/errata/RHSA-2026:33482
access.redhat.comaccess.redhat.com/errata/RHSA-2026:49522
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-48165
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2488458
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-48165.json

Frequently asked

questions

Yes, but only under specific conditions. An attacker must be able to authenticate to MariaDB with a sufficiently privileged account that can modify the affected global system variables and then cause or wait for an SST operation on a joiner node.

Exploitation requires high database privileges, typically administrative roles capable of executing SET GLOBAL on cluster-related system variables. Low-privileged accounts without such rights cannot directly trigger the vulnerable behavior.

The safest pattern is to remove any direct reliance on shell command construction from user-controlled or database-configurable data, enforce strict whitelisting of acceptable values for SST-related variables, and ensure that external process invocation uses parameterized APIs that treat configuration as data only.

Adopt a design rule that configuration values must never be treated as executable fragments, implement rigorous validation and normalization for all inputs that cross trust boundaries into OS-level operations, limit administrative privileges, and include explicit checks for command construction patterns in security reviews and automated tooling.

Find out what's already
exploitable in your codebase.