Every CVE Search/ Get API key

CVE-2021-22904

Possible DoS Vulnerability in Action Controller Token Authentication

7.5 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

4.87%Up 4.1 points since Jun 12, 2021
90%50%10%1%

What each source reports

NVD Score used 7.5

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.

Record
CVE-2021-22904
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-400
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-22904
Weakness
CWE-400
Updated
2026-11-02
EUVDEUVD-2021-1009 No score

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.

Record
EUVD-2021-1009
Updated
2026-11-03
GitHub AdvisoriesGHSA-7wjx-3g7j-8584 7.5

Possible DoS Vulnerability in Action Controller Token Authentication

There is a possible DoS vulnerability in the Token Authentication logic in Action Controller.

Versions Affected: >= 4.0.0 Not affected: < 4.0.0 Fixed Versions: 6.1.3.2, 6.0.3.7, 5.2.4.6, 5.2.6

Impact

Impacted code uses authenticate_or_request_with_http_token or authenticate_with_http_token for request authentication. Impacted code will look something like this:

class PostsController < ApplicationController
  before_action :authenticate

  private

  def authenticate
    authenticate_or_request_with_http_token do |token, options|
      # ...
    end
  end
end

All users running an affected release should either upgrade or use one of the workarounds immediately.

Releases

The fixed releases are available at the normal locations.

Workarounds

The following monkey patch placed in an initializer can be used to work around the issue:

module ActionController::HttpAuthentication::Token
  AUTHN_PAIR_DELIMITERS = /(?:,|;|\t)/
end

Patches

To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.

  • 5-2-http-authentication-dos.patch - Patch for 5.2 series
  • 6-0-http-authentication-dos.patch - Patch for 6.0 series
  • 6-1-http-authentication-dos.patch - Patch for 6.1 series

Please note that only the 6.1.Z, 6.0.Z, and 5.2.Z series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits

Thank you to https://hackerone.com/wonda_tea_coffee for reporting this issue!

Record
GHSA-7wjx-3g7j-8584
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSV 7.5

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.

Record
CVE-2021-22904
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-22904 7.5

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.

Record
DEBIAN-CVE-2021-22904
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 8 moreShow less
OSVGHSA-7wjx-3g7j-8584 7.5

Possible DoS Vulnerability in Action Controller Token Authentication

There is a possible DoS vulnerability in the Token Authentication logic in Action Controller.

Versions Affected: >= 4.0.0 Not affected: < 4.0.0 Fixed Versions: 6.1.3.2, 6.0.3.7, 5.2.4.6, 5.2.6

Impact

Impacted code uses authenticate_or_request_with_http_token or authenticate_with_http_token for request authentication. Impacted code will look something like this:

class PostsController < ApplicationController
  before_action :authenticate

  private

  def authenticate
    authenticate_or_request_with_http_token do |token, options|
      # ...
    end
  end
end

All users running an affected release should either upgrade or use one of the workarounds immediately.

Releases

The fixed releases are available at the normal locations.

Workarounds

The following monkey patch placed in an initializer can be used to work around the issue:

module ActionController::HttpAuthentication::Token
  AUTHN_PAIR_DELIMITERS = /(?:,|;|\t)/
end

Patches

To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.

  • 5-2-http-authentication-dos.patch - Patch for 5.2 series
  • 6-0-http-authentication-dos.patch - Patch for 6.0 series
  • 6-1-http-authentication-dos.patch - Patch for 6.1 series

Please note that only the 6.1.Z, 6.0.Z, and 5.2.Z series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits

Thank you to https://hackerone.com/wonda_tea_coffee for reporting this issue!

Record
GHSA-7wjx-3g7j-8584
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSVOESA-2021-1248 7.5

rubygem-actionpack security update

Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.

Security Fix(es):

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.(CVE-2021-22904)

Record
OESA-2021-1248
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2021:4702 9.8

Red Hat Security Advisory: Satellite 6.10 Release

Record
RHSA-2021:4702
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-22904 7.5

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.

Record
UBUNTU-CVE-2021-22904
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2024:11317-1 No score

ruby2.7-rubygem-actionpack-5.2-5.2.6-1.2 on GA media

These are all security issues fixed in the ruby2.7-rubygem-actionpack-5.2-5.2.6-1.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11317-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11318-1 No score

ruby2.7-rubygem-actionpack-6.0-6.0.4-1.2 on GA media

These are all security issues fixed in the ruby2.7-rubygem-actionpack-6.0-6.0.4-1.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11318-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:11821-1 No score

ruby3.1-rubygem-actionpack-6.0-6.0.4.4-1.1 on GA media

These are all security issues fixed in the ruby3.1-rubygem-actionpack-6.0-6.0.4.4-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11821-1
Updated
2026-11-02
OSVSUSE-SU-2022:2108-1 No score

Security update for rubygem-actionpack-5_1, rubygem-activesupport-5_1

This update for rubygem-actionpack-5_1 and rubygem-activesupport-5_1 fixes the following issues:

  • CVE-2021-22904: Fixed possible DoS Vulnerability in Action Controller Token Authentication (bsc#1185780)
  • CVE-2022-23633: Fixed possible exposure of information vulnerability in Action Pack (bsc#1196182)
Record
SUSE-SU-2022:2108-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
actionpack
RubyGems
6.0.0 to 6.0.3.6
6.0.3.7
actionpack
RubyGems
6.1.0 to 6.1.3.1
6.1.3.2
actionpack
RubyGems
5.2.5 up to 5.2.6
5.2.6
actionpack
RubyGems
4.0.0 to 5.2.4.5
5.2.4.6
rails
Debian:12
before 2:6.0.3.7+dfsg-1
2:6.0.3.7+dfsg-1
rails
Debian:13
before 2:6.0.3.7+dfsg-1
2:6.0.3.7+dfsg-1
rails
Debian:14
before 2:6.0.3.7+dfsg-1
2:6.0.3.7+dfsg-1
rails
Debian:9
From an advisory covering 2 CVEs
before 2:4.2.7.1-1+deb9u5, plus listed versions
2:4.2.7.1-12:4.2.7.1-1+deb9u12:4.2.7.1-1+deb9u22:4.2.7.1-1+deb9u32:4.2.7.1-1+deb9u4
2:4.2.7.1-1+deb9u5
rails
Debian:10
From an advisory covering 3 CVEs
before 2:5.2.2.1+dfsg-1+deb10u3, plus listed versions
2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1+deb10u12:5.2.2.1+dfsg-1+deb10u2
2:5.2.2.1+dfsg-1+deb10u3
actionpack
RubyGems
6.0.0 up to 6.0.3.7, plus listed versions
6.0.16.0.1.rc16.0.26.0.2.16.0.2.2
Show 10 moreShow less
6.0.2.rc16.0.2.rc26.0.36.0.3.16.0.3.26.0.3.36.0.3.46.0.3.56.0.3.66.0.3.rc1
6.0.3.7
Show 55 moreShow less
Affected packages
PackageAffectedFixed
actionpack
RubyGems
6.1.0 up to 6.1.3.2, plus listed versions
6.1.16.1.26.1.2.16.1.36.1.3.1
6.1.3.2
actionpack
RubyGems
4.0.0 up to 5.2.4.6, plus listed versions
4.0.14.0.1.rc14.0.1.rc24.0.1.rc34.0.1.rc4
Show 45 moreShow less
4.0.104.0.10.rc14.0.10.rc24.0.114.0.11.14.0.124.0.134.0.13.rc14.0.24.0.34.0.44.0.4.rc14.0.54.0.64.0.6.rc14.0.6.rc24.0.6.rc34.0.74.0.84.0.94.1.04.1.0.beta14.1.0.beta24.1.0.rc14.1.0.rc24.1.14.1.104.1.10.rc14.1.10.rc24.1.10.rc34.1.10.rc44.1.114.1.124.1.12.rc14.1.134.1.13.rc14.1.144.1.14.14.1.14.24.1.14.rc14.1.14.rc24.1.154.1.15.rc14.1.164.1.16.rc1
5.2.4.6
rubygem-actionpack
openEuler:20.03-LTS-SP1
before 5.2.4.4-3.oe1
5.2.4.4-3.oe1
python-ecdsa
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:0.13.3-2.el7pc
0:0.13.3-2.el7pc
python3-ecdsa
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:0.13.3-2.el7pc
0:0.13.3-2.el7pc
python-ecdsa
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:0.13.3-2.el7pc
0:0.13.3-2.el7pc
python3-ecdsa
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:0.13.3-2.el7pc
0:0.13.3-2.el7pc
tfm-rubygem-activerecord-session_store
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:2.0.0-1.el7sat
0:2.0.0-1.el7sat
satellite
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:6.10.0-3.el7sat
0:6.10.0-3.el7sat
satellite
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:6.10.0-3.el7sat
0:6.10.0-3.el7sat
candlepin
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:4.0.9-1.el7sat
0:4.0.9-1.el7sat
python-pyyaml
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:5.4.1-1.el7pc
0:5.4.1-1.el7pc
python3-pyyaml
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:5.4.1-1.el7pc
0:5.4.1-1.el7pc
python-pyyaml
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:5.4.1-1.el7pc
0:5.4.1-1.el7pc
python3-pyyaml
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:5.4.1-1.el7pc
0:5.4.1-1.el7pc
tfm-rubygem-nokogiri
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:1.11.3-2.el7sat
0:1.11.3-2.el7sat
tfm-rubygem-nokogiri
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:1.11.3-2.el7sat
0:1.11.3-2.el7sat
satellite-capsule
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:6.10.0-3.el7sat
0:6.10.0-3.el7sat
foreman
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:2.5.2.17-2.el7sat
0:2.5.2.17-2.el7sat
foreman
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:2.5.2.17-2.el7sat
0:2.5.2.17-2.el7sat
python-aiohttp
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:3.7.4-1.el7pc
0:3.7.4-1.el7pc
python-aiohttp
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:3.7.4-1.el7pc
0:3.7.4-1.el7pc
tfm-rubygem-actionpack
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:6.0.3.7-1.el7sat
0:6.0.3.7-1.el7sat
tfm-rubygem-rails
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:6.0.3.7-1.el7sat
0:6.0.3.7-1.el7sat
python3-django
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:2.2.24-1.el7pc
0:2.2.24-1.el7pc
python3-django
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:2.2.24-1.el7pc
0:2.2.24-1.el7pc
tfm-rubygem-puma
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:5.3.2-1.el7sat
0:5.3.2-1.el7sat
tfm-rubygem-addressable
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:2.8.0-1.el7sat
0:2.8.0-1.el7sat
python-urllib3
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:1.26.5-1.el7pc
0:1.26.5-1.el7pc
python3-urllib3
Red Hat:satellite_capsule:6.10::el7
From an advisory covering 21 CVEs
before 0:1.26.5-1.el7pc
0:1.26.5-1.el7pc
python-urllib3
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:1.26.5-1.el7pc
0:1.26.5-1.el7pc
python3-urllib3
Red Hat:satellite:6.10::el7
From an advisory covering 21 CVEs
before 0:1.26.5-1.el7pc
0:1.26.5-1.el7pc
rubygem-actionpack-5_1
SUSE:Linux Enterprise High Availability Extension 15
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
SUSE:Linux Enterprise High Availability Extension 15
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP1
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP1
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP2
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP2
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP3
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP3
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP4
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
SUSE:Linux Enterprise High Availability Extension 15 SP4
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
openSUSE:Leap 15.3
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
openSUSE:Leap 15.3
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rubygem-actionpack-5_1
openSUSE:Leap 15.4
From an advisory covering 2 CVEs
before 5.1.4-150000.3.12.1
5.1.4-150000.3.12.1
rubygem-activesupport-5_1
openSUSE:Leap 15.4
From an advisory covering 2 CVEs
before 5.1.4-150000.3.6.1
5.1.4-150000.3.6.1
rails
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
2:4.1.10-12:4.2.5-12:4.2.5.1-12:4.2.5.2-22:4.2.6-12:4.2.6-1ubuntu0.1~esm12:4.2.6-1ubuntu0.1~esm2
None known
rails
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
2:4.2.9-22:4.2.9-42:4.2.10-0ubuntu42:4.2.10-0ubuntu4+esm12:4.2.10-0ubuntu4+esm2
None known
rails
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
2:5.2.2.1+dfsg-1ubuntu12:5.2.3+dfsg-32:5.2.3+dfsg-3ubuntu0.1~esm1
None known
rails
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
2:6.0.3.7+dfsg-22:6.1.4.1+dfsg-8ubuntu22:6.1.4.1+dfsg-8ubuntu2+esm1
None known
rails
Ubuntu:24.04:LTS
All versions, plus listed versions
2:6.1.7.3+dfsg-2build12:6.1.7.3+dfsg-3
None known
rails
Ubuntu:25.10
All versions, plus listed versions
2:6.1.7.3+dfsg-72:7.2.2.1+dfsg-7
None known
rails
Ubuntu:26.10
All versions, plus listed versions
2:7.2.3+dfsg-22:7.2.3.2+dfsg-2
None known
rails
Ubuntu:26.04:LTS
All versions, plus listed versions
2:7.2.2.1+dfsg-72:7.2.2.2+dfsg-22:7.2.3+dfsg-2
None known
rubygem-actionpack-6.0
openSUSE:Tumbleweed
From an advisory covering 12 CVEs
before 6.0.4.4-1.1
6.0.4.4-1.1

History

History
RecordedChangedSources
affected, facts
aliases, productsEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-22904 is a high vulnerability (CVSS 7.5) in Rails Https://github.com/rails/rails, published May 5, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 4.87%, the 92nd percentile. Fixed in actionpack 6.0.3.7.

References

Show 194 moreShow less
This page doesn't list everything

Left out here: 120 versions and 423 references. The JSON record has them.

MoveEnter Open