Skip to content

GHSA-jjhx-jhvp-74wq BIT-rails-2024-26142 CVE-2024-26142

Rails has possible ReDoS vulnerability in Accept header parsing in Action Dispatch

High RubyGems
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
1.50%
Chance of exploitation in the next 30 days. Higher than 74.24% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1333 Inefficient Regular Expression Complexity
Fix
7.1.3.1
Upgrade actionpack to this version or later

Description

Possible ReDoS vulnerability in Accept header parsing in Action Dispatch

There is a possible ReDoS vulnerability in the Accept header parsing routines of Action Dispatch. This vulnerability has been assigned the CVE identifier CVE-2024-26142.

Versions Affected: >= 7.1.0, < 7.1.3.1 Not affected: < 7.1.0 Fixed Versions: 7.1.3.1

Impact

Carefully crafted Accept headers can cause Accept header parsing in Action Dispatch to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or use one of the workarounds immediately.

Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected.

Releases

The fixed releases are available at the normal locations.

Workarounds

There are no feasible workarounds for this issue.

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.

  • 7-1-accept-redox.patch - Patch for 7.1 series

Credits

Thanks svalkanov for the report and patch!

Affected versions

RubyGems

PackageVulnerableFixed in
actionpack
>= 7.1.0, < 7.1.3.1
7.1.3.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

actionpack RubyGems → 7.1.3.1

bundler
bundle update actionpack # Gemfile: gem "actionpack", ">= 7.1.3.1"

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-1333: Inefficient Regular Expression Complexity

The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.

How to prevent it
  • Architecture and Design: Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
  • System Configuration: Set backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
  • Implementation: Do not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
  • Implementation: Limit the length of the input that the regular expression will process.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-6x85-j5j2-27jx
actionpack Path Traversal vulnerability
High Known exploited Also affects actionpack
GHSA-xrr4-p6fq-hjg7
Directory traversal vulnerability in Action View in Ruby on Rails
High Known exploited Also affects actionpack
GHSA-pgm4-439c-5jp6
Rails has a possible XSS vulnerability in its Action Pack debug exceptions
Medium Also affects actionpack
GHSA-vfm5-rmrh-j26v
Possible Content Security Policy bypass in Action Dispatch
Low Also affects actionpack
GHSA-vfg9-r3fq-jvx4
Possible ReDoS vulnerability in HTTP Token authentication in Action Controller
Medium Also affects actionpack
GHSA-x76w-6vjr-8xgj
Possible ReDoS vulnerability in query parameter filtering in Action Dispatch
Medium Also affects actionpack
GHSA-fwhr-88qx-h9g7
Missing security headers in Action Pack on non-HTML responses
Critical Also affects actionpack
GHSA-9822-6m93-xqf4
Rails has possible XSS Vulnerability in Action Controller
Medium Also affects actionpack
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor