VYPR
High severityNVD Advisory· Published Jun 11, 2021· Updated Aug 3, 2024

CVE-2021-22904

CVE-2021-22904

Description

The actionpack ruby gem before 6.1.3.2, 6.0.3.7, 5.2.4.6, 5.2.6 suffers from a possible denial of service vulnerability in the Token Authentication logic in Action Controller due to a too permissive regular expression. Impacted code uses authenticate_or_request_with_http_token or authenticate_with_http_token for request authentication.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A denial of service vulnerability in Action Pack's Token Authentication due to a permissive regex allows attackers to cause excessive resource consumption.

Vulnerability

The actionpack Ruby gem before versions 6.1.3.2, 6.0.3.7, 5.2.4.6, and 5.2.6 contains a denial of service vulnerability in the Token Authentication logic of Action Controller. The issue stems from a too permissive regular expression used to parse HTTP Authorization headers when the application uses authenticate_or_request_with_http_token or authenticate_with_http_token for request authentication. All versions starting from 4.0.0 are affected [1][4].

Exploitation

An attacker can exploit this vulnerability by sending a specially crafted HTTP request with a malformed Authorization header containing a token that triggers catastrophic backtracking in the regular expression. No authentication is required, and the attacker only needs network access to the target application. The malicious header causes the regex engine to consume excessive CPU time, leading to a denial of service [4].

Impact

Successful exploitation results in a denial of service condition, where the affected server becomes unresponsive or significantly degraded due to high CPU usage. This can impact availability for legitimate users. The vulnerability does not lead to information disclosure, privilege escalation, or remote code execution [1][4].

Mitigation

Users should upgrade to the fixed versions: 6.1.3.2, 6.0.3.7, 5.2.4.6, or 5.2.6. For those unable to upgrade immediately, a monkey patch workaround is available: add module ActionController::HttpAuthentication::Token; AUTHN_PAIR_DELIMITERS = /(?:,|;|\t)/; end to an initializer. Patches for the supported release series (5.2, 6.0, 6.1) are provided in the official advisory [4]. Users of unsupported releases (before 4.0.0 or between 4.0.0 and 5.2) are advised to upgrade as soon as possible [4].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
actionpackRubyGems
>= 6.0.0, < 6.0.3.76.0.3.7
actionpackRubyGems
>= 6.1.0, < 6.1.3.26.1.3.2
actionpackRubyGems
>= 5.2.5, < 5.2.65.2.6
actionpackRubyGems
>= 4.0.0, < 5.2.4.65.2.4.6

Affected products

17

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

12

News mentions

0

No linked articles in our index yet.