Skip to content
RCE Advisory Advanced CVE-2022-39379

GHSL-2022-067: Remote Code Execution (RCE) in Fluentd - CVE-2022-39379

Fluentd, when configured with the Oj JSON parser in object mode, deserialises untrusted JSON into arbitrary Ruby objects. An unauthenticated attacker could send a crafted JSON payload to execute arbitrary code on the server.

p Follow

Originally disclosed on GitHub Security Lab

A remote code execution (RCE) vulnerability in non-default configurations of Fluentd allowed unauthenticated attackers to execute arbitrary code via specially crafted JSON payloads.

p-, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Oj JSON parser was configured to use 'object' mode, which allows deserialisation of arbitrary Ruby objects from untrusted input, enabling gadget chain exploitation.

Impact

This issue may lead to Remote code execution (RCE) if vulnerable configurations are used.

What the attacker needed

Oj gem installed; Fluentd v1.13.2 or later; FLUENT_OJ_OPTION_MODE=object; JSON parser configured

How it was found

  1. Install the Oj gem so Fluentd uses it as its JSON parser.
  2. Set the environment variable FLUENT_OJ_OPTION_MODE to object.
  3. Configure Fluentd with an HTTP source that parses JSON.
  4. Start Fluentd.
  5. Send a crafted JSON payload to the HTTP endpoint to trigger deserialisation and execute code.

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 report has not been written yet. The Original tab links to the source.

Fluentd is a tool that collects and processes logs. Normally it parses JSON safely, but if a special setting is turned on, it can be tricked into creating dangerous Ruby objects from the JSON. This lets an attacker run their own commands on the server, but only if that non-default setting is enabled.

What is RCE?

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

More by p

View all

49 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.