Skip to content
RCE Write-up Advanced

Remote Code Execution via Insecure Deserialization in Wazuh XDR/S

The Wazuh cluster master deserialised JSON from authenticated worker nodes using a helper that dynamically imported modules and instantiated classes named in the input. An attacker who compromised a worker could therefore run arbitrary operating system commands on the master.

Kevin Dicks FRSA Follow

Published on medium.com

Wazuh is an open-source XDR/SIEM platform providing endpoint monitoring, threat detection, log aggregation, distributed telemetry collection, and security orchestration capabilities across clustered infrastructures [1]. The platform supports multi-node deployments consisting of master and worker nodes communicating…

Kevin Dicks FRSA, on medium.com

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The cluster master reconstructed objects from worker-supplied JSON by importing any named Python module and instantiating any named class, without an allow list.

Impact

An attacker with authenticated cluster access could execute arbitrary commands on the cluster master, and transport encryption did not prevent this.

What the attacker needed

Compromised worker node or cluster credentials; ability to send authenticated cluster messages

The fix

The text recommends replacing dynamic object reconstruction with explicit allow lists, strict schemas and static object mappings, and treating internal components as hostile.

How it was found

  1. Compromise a worker node or obtain cluster credentials so you can send authenticated cluster messages.
  2. Send a crafted JSON object containing module, class and argument metadata to the master.
  3. The master parses the JSON and passes it to the vulnerable object reconstruction helper.
  4. The helper imports the named module and resolves the named class.
  5. The helper instantiates the class with the supplied arguments, executing the command on the master.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Wazuh is a security monitoring platform that can run across several servers. The main server trusted messages from the other servers so much that it would follow instructions in those messages about which piece of code to run. If an attacker took over one of the other servers, they could use that trust to run their own commands on the main server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.