/

CVE-2026-49261

Severity:

CRITICAL RISK

(10.0)

Command Injection (CWE-78) via wsrep_notify_cmd in MariaDB

CVE-2026-49261

Modified

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Command Execution on Database Host

Severity:

CRITICAL RISK

(10.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

MariaDB Galera deployments with wsrep_notify_cmd enabled may execute shell commands embedded in the joiner node name, leading to arbitrary command execution on the server host.

This becomes especially risky in clustered environments where node names can be influenced by untrusted or partially trusted operators or automation.

Affected context

The vulnerability arises in MariaDB server deployments that:

  • Run Galera-based clustering or similar replication with wsrep_notify_cmd enabled
  • Pass node join/leave events into shell commands via wsrep_notify_cmd
  • Incorporate the joiner node name into the command line without proper escaping or sanitization

It is most relevant where node names may be configured by scripts, orchestration systems, or administrators operating under weaker trust assumptions.

Exploit preconditions

  • Attack surface: Cluster control and replication layer, specifically node join events.
  • Required access: Ability to influence or set the joiner node's name, directly or via cluster/orchestration configuration.
  • Trigger point: A vulnerable MariaDB node invokes wsrep_notify_cmd when another node joins, passing the crafted node name into a shell command.
  • Why exploitation is possible: The joiner node name is interpolated into a shell command context without proper quoting or sanitization, allowing shell metacharacters in the name to be interpreted as additional commands.

Why this happens

The underlying bug class is command injection, as described by CWE-78: Improper Neutralization of Special Elements used in an OS Command.

MariaDB's wsrep_notify_cmd feature constructs a shell command using dynamic data (including the joiner node name) and delegates execution to the system shell.

Because node names are treated as trusted and incorporated directly into the command string, any shell metacharacters in that value can alter the intended command, leading to arbitrary command execution under the database server's OS account.

Potential impact

  • Execution of arbitrary commands on the database server host
  • Complete compromise of the MariaDB instance and underlying host OS
  • Exfiltration or destruction of database contents
  • Pivoting to other systems reachable from the compromised host
  • Disruption of high-availability clusters and potential data loss

General mitigation guidance

Effective mitigation focuses on reducing trust in dynamic inputs and avoiding direct shell invocation when handling cluster events.

Common defensive patterns include:

  • Disabling optional features that execute shell commands with dynamic parameters when not strictly necessary (such as wsrep_notify_cmd)
  • Using dedicated, parameterized interfaces (e.g., scripts that accept arguments as positional parameters, not via string concatenation) rather than constructing raw shell command strings
  • Strictly validating and constraining node names to a safe character set (for example, alphanumerics and limited punctuation) before they are used in any OS-level context
  • Running database services and any notification scripts with least-privilege OS accounts to limit blast radius if a command injection occurs
  • Separating monitoring/notification responsibilities from the database process where possible, so cluster events are not handled directly via shell

How teams detect issues like this

Organizations can detect similar issues and manifestations of this vulnerability by:

  • Reviewing configuration for features that execute shell commands (wsrep_notify_cmd, hooks, notification scripts) and checking how user-controlled or environment-derived values are passed to them
  • Applying static analysis or linters to deployment and automation scripts to flag string-based command construction and unquoted interpolation of variables
  • Conducting focused code and configuration reviews for Galera/MariaDB cluster setups, paying attention to any integration points with the shell
  • Enforcing security policies that forbid arbitrary shell commands in production database configurations unless explicitly reviewed and approved
  • Monitoring logs and process execution (e.g., via auditd or EDR tools) for unexpected commands originating from database processes or notification scripts

Sources

SourceLink
github.comgithub.com/MariaDB/server/security/advisories/GHSA-3p3m-4x7c-p4pw
jira.mariadb.orgjira.mariadb.org/browse/MDEV-39721
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/errata/RHSA-2026:52848
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-49261
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2487957
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-49261.json

Frequently asked

questions

Yes, it can be remotely exploitable in clustered environments where an attacker can influence the joiner node's name, for example via cluster configuration, orchestration systems, or misconfigured self-service interfaces.

An attacker must be able to control or significantly influence the name assigned to a joiner node that connects to the vulnerable MariaDB cluster. This typically requires some level of access to cluster management, provisioning tooling, or configuration, but not necessarily direct shell access to the database server.

The safest pattern is to avoid constructing shell commands from untrusted or partially trusted inputs. For this specific class of issue, disabling optional features that execute shell commands with dynamic data and replacing them with safer, parameterized interfaces or dedicated APIs significantly reduces risk.

To prevent similar problems, design operational hooks and notification mechanisms such that they do not depend on string-concatenated shell commands; constrain and validate all identifiers (like node names) before using them in OS contexts; and incorporate security reviews and automated checks for command construction patterns in infrastructure-as-code and database configuration workflows.

Find out what's already
exploitable in your codebase.