# CVE-2021-41186: ReDoS vulnerability in parser_apache2

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

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Oct 2021
- **Updated:** 4 Aug 2024
- **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, openSUSE-SU-2026:10346-1

## 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 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2021-41186?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `fluentd` | Bitnami | From 0.14.14 | 1.14.2 |
| `fluentd` | RubyGems | From 0.14.14 | 1.14.2 |
| `fluentd` | RubyGems | From 0.14.14 | 1.14.2 |
| `ruby3.2-rubygem-fluentd` | openSUSE:Tumbleweed | All versions | 1.15.3-1.4 |
| `rubygem-fluentd` | openSUSE:Tumbleweed | All versions | 1.14.4-1.1 |
| `rubygem-fluentd` | openSUSE:Tumbleweed | All versions | 1.17.0-1.1 |
| `rubygem-fluentd` | openSUSE:Tumbleweed | All versions | 1.17.1-1.3 |
| `rubygem-fluentd` | openSUSE:Tumbleweed | All versions | 1.17.1-1.5 |

Products: Fluentd Fluentd.

## How do I fix CVE-2021-41186?

Upgrade fluentd to 1.14.2 or later.

## Is CVE-2021-41186 being exploited?

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

## Other vulnerabilities in fluentd

- [CVE-2026-44024](https://insights.sbomify.com/CVE-2026-44024/): Fluentd: Remote Code Execution (RCE) via Arbitrary File Write in `${tag}` Placeholder (critical 9.8)
- [CVE-2017-10906](https://insights.sbomify.com/CVE-2017-10906/): Fluentd Escape Sequence Injection Vulnerability (critical 9.8)
- [CVE-2020-21514](https://insights.sbomify.com/CVE-2020-21514/): Fluent Fluentd and Fluent-ui use default password (high 8.8)
- [CVE-2026-44025](https://insights.sbomify.com/CVE-2026-44025/): Fluentd: Exposure of Sensitive Information via Monitor Agent API (high 7.5)
- [CVE-2026-44160](https://insights.sbomify.com/CVE-2026-44160/): Fluentd: Denial of Service (DoS) via Gzip Decompression Bomb in `in_http` and `in_forward` (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-41186 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2021-41186 in the wild and no public exploit code.

Affected packages and fixed versions:
- fluentd (Bitnami): affected from 0.14.14; fixed in 1.14.2
- fluentd (RubyGems): affected from 0.14.14; fixed in 1.14.2
- fluentd (RubyGems): affected from 0.14.14; fixed in 1.14.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-41186/ (Markdown: https://insights.sbomify.com/CVE-2021-41186/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-41186
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-41186
- OSV: https://osv.dev/vulnerability/CVE-2021-41186

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-41186/
Summaries are generated and may contain mistakes; the official description above is the record.
