CVE-2021-41186: Fluentd Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-hwhf-64mh-r662
CVSS 5.9
CWE-400
Published
Advisory Summary

CVE-2021-41186 is a MODERATE (CVSS 5.9) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Fluentd libraries in the RubyGems ecosystem. The issue involves redos vulnerability in parser_apache2. Remediation is available by upgrading affected packages to version 1.14.2.

CVE-2021-41186 at a Glance

CVE Identifier CVE-2021-41186
GHSA Identifier GHSA-hwhf-64mh-r662
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Fluentd
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2021-41186

To remediate this vulnerability, upgrade all affected Fluentd dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fluentd fixed: 1.14.2
Upgrade fluentd to 1.14.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for fluentd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-41186, inspect your project dependencies for Fluentd:

inspect dependencies for fluentd

Analyze the terminal output to locate any version of Fluentd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Fluentd, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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. ### Patches v1.14.2 ### Workarounds Either of the following: * Don't use parser_apache2 for parsing logs which cannot guarantee generated by Apache. * 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). ### References * [CVE-2021-41186](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41186) * [GHSA-hwhf-64mh-r662](https://github.com/fluent/fluentd/security/advisories/GHSA-hwhf-64mh-r662) * [GHSL-2021-102](https://securitylab.github.com/advisories/GHSL-2021-102-fluent-fluentd/) * https://github.com/fluent/fluentd/blob/master/CHANGELOG.md#v1142

CVE-2021-41186 Affected Fluentd Versions

1 component(s)
Fixed Versions:
1.14.2
Product / Package Ecosystem Affected Versions Fixed Version
fluentd
RubyGems
≥ 0.14.14
< 1.14.2
1.14.2

References

Frequently Asked Questions

What is CVE-2021-41186?
CVE-2021-41186 is a security vulnerability in Fluentd involving ReDoS vulnerability in parser_apache2 under CWE-400: Uncontrolled Resource Consumption.
Which Fluentd versions are affected?
Affected versions include releases prior to 1.14.2 across affected packages: fluentd.
What version fixes CVE-2021-41186?
Upgrading to 1.14.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fluentd affected?
Yes, fluentd is affected in releases prior to 1.14.2. Upgrade your dependency to 1.14.2 or later.
What is the CVSS score of CVE-2021-41186?
CVE-2021-41186 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-41186?
CVE-2021-41186 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2021-41186?
Run the dependency tree command: 'inspect dependencies for fluentd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hwhf-64mh-r662",
  "modified" : "2021-11-04T17:05:51Z",
  "published" : "2021-11-01T19:16:31Z",
  "aliases" : [ "CVE-2021-41186" ],
  "summary" : "ReDoS vulnerability in parser_apache2",
  "details" : "### Impact\nparser_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.\n\n### Patches\nv1.14.2\n\n### Workarounds\nEither of the following:\n\n* Don't use parser_apache2 for parsing logs which cannot guarantee generated by Apache.\n* 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).\n\n### References\n* [CVE-2021-41186](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41186)\n* [GHSA-hwhf-64mh-r662](https://github.com/fluent/fluentd/security/advisories/GHSA-hwhf-64mh-r662)\n* [GHSL-2021-102](https://securitylab.github.com/advisories/GHSL-2021-102-fluent-fluentd/)\n* https://github.com/fluent/fluentd/blob/master/CHANGELOG.md#v1142\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "fluentd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.14.14"
      }, {
        "fixed" : "1.14.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fluent/fluentd/security/advisories/GHSA-hwhf-64mh-r662"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41186"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluent/fluentd/commit/5482a3d049dab351de0be68f4b4bc562319d8511"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fluent/fluentd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluent/fluentd/blob/master/CHANGELOG.md#v1142"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/securitylab-vulnerabilities/blob/52dc4a2a828c6dc24231967c2937ad92038184a9/vendor_reports/GHSL-2021-102-fluent-fluentd.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/fluentd/CVE-2021-41186.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-29T13:44:13Z",
    "nvd_published_at" : "2021-10-29T14:15:00Z"
  }
}