{"id":"CVE-2021-22902","aliases":["CVE-2021-22902","GHSA-g8ww-46x2-2p65"],"related":[],"kind":"vulnerability","state":"published","title":"Denial of Service in Action Dispatch","summary":"The actionpack ruby gem (a framework for handling and responding to web requests in Rails) before 6.0.3.7, 6.1.3.2 suffers from a possible denial of service vulnerability in the Mime type parser of Action Dispatch. Carefully crafted Accept headers can cause the mime type parser in Action Dispatch to do catastrophic backtracking in the regular expression engine.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The actionpack ruby gem (a framework for handling and responding to web requests in Rails) before 6.0.3.7, 6.1.3.2 suffers from a possible denial of service vulnerability in the Mime type parser of Action Dispatch. Carefully crafted Accept headers can cause the mime type parser in Action Dispatch to do catastrophic backtracking in the regular expression engine.","source":"cvelist"},{"lang":"en","text":"Impact\n------\nThere is a possible Denial of Service vulnerability in Action Dispatch. Carefully crafted Accept headers can cause the mime type parser in Action Dispatch to do catastrophic backtracking in the regular expression engine.\n\nReleases\n--------\nThe fixed releases are available at the normal locations.\n\nWorkarounds\n-----------\nThe following monkey patch placed in an initializer can be used to work around the issue.\n\n```ruby\nmodule Mime\n  class Type\n    MIME_REGEXP = /\\A(?:\\*\\/\\*|#{MIME_NAME}\\/(?:\\*|#{MIME_NAME})(?>\\s*#{MIME_PARAMETER}\\s*)*)\\z/\n  end\nend\n```\n\nPatches\n-------\nTo 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.\n\n* 6-0-Prevent-catastrophic-backtracking-during-mime-parsin.patch - Patch for 6.0 series\n* 6-1-Prevent-catastrophic-backtracking-during-mime-parsin.patch - Patch for 6.1 series\n\nPlease 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.\n\nCredits\n-------\n\nThanks to Security Curious <security...@pm.me> for reporting this!","format":"markdown","source":"ghsa"},{"lang":"es","text":"El actionpack ruby gem (un marco de trabajo para manejar y responder a peticiones web en Rails) versiones anteriores a 6.0.3.7, 6.1.3.2 sufre de una posible vulnerabilidad de denegación de servicio en el analizador de tipos Mime de Action Dispatch. Unas cabeceras Accept cuidadosamente diseñadas pueden hacer que el analizador de tipos mime de Action Dispatch realice un retroceso catastrófico en el motor de expresiones regulares","source":"nvd"}],"published":"2021-05-05T19:48:21.000Z","modified":"2026-06-17T03:37:59.480Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":"Fixed in 6.0.3.7, 6.1.3.2","status":"affected"}],"product":"https://github.com/rails/rails","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.0.3.7"}],"ecosystem":"RubyGems","package":"actionpack","purl":"pkg:gem/actionpack","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.1.0","status":"affected","fixed":"6.1.3.2"}],"ecosystem":"RubyGems","package":"actionpack","purl":"pkg:gem/actionpack","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"6.0.0","fixed":"6.0.3.7"},{"status":"affected","introduced":"6.1.0","fixed":"6.1.0.2"}],"vendor":"rubyonrails","product":"rails","cpe":"cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://hackerone.com/reports/1138654","tags":["permissions-required","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://discuss.rubyonrails.org/t/cve-2021-22902-possible-denial-of-service-vulnerability-in-action-dispatch/77866","tags":["exploit","mitigation","patch","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-22902","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rails/rails/releases/tag/v6.0.3.7","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rails/rails/releases/tag/v6.1.3.2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2021-22902.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://groups.google.com/g/rubyonrails-security/c/_5ID_ld9u1c","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"hackerone","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-22902","url":"https://www.cve.org/CVERecord?id=CVE-2021-22902","licence":"CVE Terms of Use","modified":"2024-08-03T18:58:25.713Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g8ww-46x2-2p65","url":"https://github.com/advisories/GHSA-g8ww-46x2-2p65","licence":"CC-BY-4.0","modified":"2024-02-16T08:21:28.149Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-22902","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-22902","licence":"Public domain","modified":"2026-06-17T03:37:59.480Z"}],"updatedAt":"2026-11-25T22:58:01.810Z","epss":{"score":0.02868,"percentile":0.87168,"date":"2026-12-01T12:00:22.000Z"}}