CVE-2021-41186 ReDoS vulnerability in parser_apache2

Medium 5.9 Published Updated

Attackers can cause a denial of service in Fluentd by sending malformed Apache logs that trigger excessive CPU usage in the parser_apache2 plugin.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-41186?

CVE-2021-41186 is a medium-severity denial of service vulnerability in fluentd, published on 29 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Fluentd collects events from various data sources and writes them to files to help unify logging infrastructure. The parser_apache2 plugin in Fluentd v0.14.14 to v1.14.1 suffers from a regular expression denial of service (ReDoS) vulnerability. A broken apache log with a certain pattern of string can spend too much time in a regular expression, resulting in the potential for a DoS attack. This issue is patched in version 1.14.2 There are two workarounds available. Either don't use parser_apache2 for parsing logs (which cannot guarantee generated by Apache), or put patched version of parser_apache2.rb into /etc/fluent/plugin directory (or any other directories specified by the environment variable `FLUENT_PLUGIN` or `--plugin` option of fluentd).

Weakness: CWE-400

Which versions are affected by CVE-2021-41186?

3 open source packages ship an affected version, including fluentd. It affects 1 product.

PackageAffectedFixed in
fluentd BitnamiFrom 0.14.141.14.2
fluentd RubyGemsFrom 0.14.141.14.2
fluentd RubyGemsFrom 0.14.141.14.2
Linux distribution packages (5)
ruby3.2-rubygem-fluentd openSUSE:TumbleweedAll versions1.15.3-1.4
rubygem-fluentd openSUSE:TumbleweedAll versions1.14.4-1.1
rubygem-fluentd openSUSE:TumbleweedAll versions1.17.0-1.1
rubygem-fluentd openSUSE:TumbleweedAll versions1.17.1-1.3
rubygem-fluentd openSUSE:TumbleweedAll versions1.17.1-1.5

Products include Fluentd Fluentd.

How do I fix CVE-2021-41186?

Upgrade fluentd to 1.14.2 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2021-41186 being exploited?

There is no known exploitation of CVE-2021-41186 in the wild and no public exploit code.

Sources

Also known as BIT-fluentd-2021-41186, GHSA-hwhf-64mh-r662, openSUSE-SU-2024:11795-1, openSUSE-SU-2024:13155-1, openSUSE-SU-2024:14072-1, openSUSE-SU-2025:15115-1 and 1 more.

Is CVE-2021-41186 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free