GHSA-vfg9-r3fq-jvx4 BIT-rails-2024-47887 CVE-2024-47887
Possible ReDoS vulnerability in HTTP Token authentication in Action Controller
- Severity
- 0.0 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 1.04%
- Chance of exploitation in the next 30 days. Higher than 64.03% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-1333 Inefficient Regular Expression Complexity
- Fix
6.1.7.9- Upgrade actionpack to this version or later
Description
There is a possible ReDoS vulnerability in Action Controller's HTTP Token authentication. This vulnerability has been assigned the CVE identifier CVE-2024-47887.
Impact
For applications using HTTP Token authentication via authenticate_or_request_with_http_token or similar, a carefully crafted header may cause header parsing to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users on Ruby 3.2 are unaffected by this issue.
Credits
Thanks to scyoon for reporting
Affected versions
RubyGems
| Package | Vulnerable | Fixed in |
|---|---|---|
| actionpack | >= 4.0.0, < 6.1.7.9 |
6.1.7.9 |
| actionpack | >= 7.0.0, < 7.0.8.5 |
7.0.8.5 |
| actionpack | >= 7.1.0, < 7.1.4.1 |
7.1.4.1 |
| actionpack | >= 7.2.0, < 7.2.1.1 |
7.2.1.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 → 6.1.7.9
- bundler
bundle update actionpack # Gemfile: gem "actionpack", ">= 6.1.7.9"
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
- Exploit maturity
- Unreported
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
Packages
Other links
- github.com/rails/rails/security/advisories/GHSA-vfg9-r3fq-jvx4
- github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2024-47887.yml
- github.com/rails/rails/commit/56b2fc3302836405b496e196a8d5fc0195e55049
- github.com/rails/rails/commit/7c1398854d51f9bb193fb79f226647351133d08a
- github.com/rails/rails/commit/8e057db25bff1dc7a98e9ae72e0083825b9ac545
- github.com/rails/rails/commit/f4dc83d8926509d0958ec21fcdbc2e7df3d32ce2
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why 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-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 |
| GHSA-jjhx-jhvp-74wq Rails has possible ReDoS vulnerability in Accept header parsing in Action Dispatch | High | Also affects actionpack |
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