Skip to content
DoS Advisory Intermediate CVE-2021-41186

GHSL-2021-102: ReDoS (Regular Expression Denial of Service) in Fluentd - CVE-2021-41186

The Apache 2 log parser in Fluentd used a regular expression whose capture groups could match the same text in two ways, so a crafted log line caused catastrophic backtracking. An attacker able to supply log lines could make the parser take exponentially longer, causing a denial of service.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

Fluentd uses a regular expression that is vulnerable to catastrophic backtracking to parse logs from the Apache 2 web server:

ghsecuritylab, 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 alternation inside the repeated capture groups lets a single character match two branches, creating exponential backtracking when the overall match fails.

Impact

An attacker who can get crafted lines into the Apache 2 log parser could cause a denial of service, with processing time doubling for each added repetition.

What the attacker needed

Attacker-controlled Apache log lines; parser configured for Apache 2 logs

The fix

The maintainers released a fix for the vulnerable regular expression.

How it was found

  1. Craft a string in the format of an Apache access log as the prefix.
  2. Add many repetitions of a two-character escape sequence as the pump.
  3. End with an extra unescaped double quote so the match fails.
  4. Feed the string to the parser and observe the processing time grow with each repetition.

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.

A regular expression is a pattern used to pull fields out of text. This one had a part that could match the same characters in two different ways, so when a line almost matched but failed at the end, the program tried a huge number of combinations before giving up. Each extra repeated character doubled the work, so a short crafted log line could keep the parser busy for a very long time.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by ghsecuritylab

View all

132 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.