CVE-2021-22904:Denial of Service vulnerability in Ruby on Rails Action Controller Token Authentication

splash
Back

Description Preview

CVE-2021-22904 affects the actionpack Ruby gem versions before 6.1.3.2, 6.0.3.7, 5.2.4.6, and 5.2.6. The vulnerability exists in the Token Authentication logic in Action Controller due to an overly permissive regular expression. When applications use `authenticate_or_request_with_http_token` or `authenticate_with_http_token` methods for request authentication, they become susceptible to denial of service attacks.

Overview

This vulnerability in Ruby on Rails' Action Controller component allows attackers to cause a denial of service condition by exploiting the token authentication mechanism. The issue stems from a too permissive regular expression used in the token authentication logic, which can be manipulated to cause excessive resource consumption. Applications that rely on token-based authentication using the affected methods are vulnerable to this attack. An attacker could potentially render the application unresponsive by sending specially crafted authentication requests, impacting availability for legitimate users.

Remediation

To address this vulnerability, update the actionpack gem to one of the following patched versions:

  • Version 6.1.3.2 or later for Rails 6.1.x
  • Version 6.0.3.7 or later for Rails 6.0.x
  • Version 5.2.4.6 or later for Rails 5.2.x
  • Version 5.2.6 or later for Rails 5.2.x

If immediate updating is not possible, consider implementing alternative authentication mechanisms temporarily or adding rate limiting and request validation before the token authentication process to mitigate potential attacks.

References

  1. Ruby on Rails Security Advisory: https://discuss.rubyonrails.org/t/cve-2021-22904-possible-dos-vulnerability-in-action-controller-token-authentication/77869
  2. HackerOne Report: https://hackerone.com/reports/1101125
  3. NetApp Security Advisory: https://security.netapp.com/advisory/ntap-20210805-0009/

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Health Care & Social Assistance
    Health Care & Social Assistance
  2. Manufacturing
    Manufacturing
  3. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  4. Retail Trade
    Retail Trade
  5. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  6. Finance and Insurance
    Finance and Insurance
  7. Management of Companies & Enterprises
    Management of Companies & Enterprises
  8. Public Administration
    Public Administration
  9. Transportation & Warehousing
    Transportation & Warehousing
  10. Accommodation & Food Services
    Accommodation & Food Services
  11. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  12. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  13. Construction
    Construction
  14. Educational Services
    Educational Services
  15. Information
    Information
  16. Mining
    Mining
  17. Other Services (except Public Administration)
    Other Services (except Public Administration)
  18. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  19. Utilities
    Utilities
  20. Wholesale Trade
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background