diff --git a/Fix-CVE-2025-59830.patch b/Fix-CVE-2025-59830.patch new file mode 100644 index 0000000000000000000000000000000000000000..c742076b2ff42d85087ada1ef1c70aca59f6a348 --- /dev/null +++ b/Fix-CVE-2025-59830.patch @@ -0,0 +1,42 @@ +From 54e4ffdd5affebcb0c015cc6ae74635c0831ed71 Mon Sep 17 00:00:00 2001 +From: Jeremy Evans +Date: Thu, 25 Sep 2025 17:51:18 +0900 +Subject: [PATCH] Unbounded parameter parsing in `Rack::QueryParser`. + +--- + CHANGELOG.md | 5 +++++ + lib/rack/query_parser.rb | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index a07dae6..611b267 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -2,6 +2,11 @@ + + All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/). + ++## [2.2.18] - 2025-09-25 ++ ++- [CVE-2025-59830](https://github.com/rack/rack/security/advisories/GHSA-625h-95r8-8xpm) Unbounded parameter parsing in `Rack::QueryParser` can lead to memory exhaustion via semicolon-separated parameters. ++ ++ + ## [2.2.4] - 2022-06-30 + + - Better support for lower case headers in `Rack::ETag` middleware. ([#1919](https://github.com/rack/rack/pull/1919), [@ioquatix](https://github.com/ioquatix)) +diff --git a/lib/rack/query_parser.rb b/lib/rack/query_parser.rb +index a6f6d68..438af68 100644 +--- a/lib/rack/query_parser.rb ++++ b/lib/rack/query_parser.rb +@@ -188,7 +188,7 @@ module Rack + raise QueryLimitError, "total query size (#{qs.bytesize}) exceeds limit (#{@bytesize_limit})" + end + +- if (param_count = qs.count(sep.is_a?(String) ? sep : '&')) >= @params_limit ++ if (param_count = qs.count(sep.is_a?(String) ? sep : '&;')) >= @params_limit + raise QueryLimitError, "total number of query parameters (#{param_count+1}) exceeds limit (#{@params_limit})" + end + +-- +2.46.0 + diff --git a/rubygem-rack.spec b/rubygem-rack.spec index 76e6592051622c409b1d2ecad5b7a8a9f0f023b5..2c8373bc638b5560eb223a8ec3f2477da013b25c 100644 --- a/rubygem-rack.spec +++ b/rubygem-rack.spec @@ -4,7 +4,7 @@ Name: rubygem-%{gem_name} Version: 2.2.4 Epoch: 1 -Release: 12 +Release: 13 Summary: A modular Ruby webserver interface License: MIT and BSD URL: https://rack.github.io/ @@ -21,6 +21,7 @@ Patch8: Fix-CVE-2025-27610.patch Patch9: Fix-CVE-2025-27111.patch Patch10: Fix-CVE-2025-25184.patch Patch11: Fix-CVE-2025-46727.patch +Patch12: Fix-CVE-2025-59830.patch BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 git BuildRequires: memcached rubygem(memcache-client) rubygem(minitest) BuildRequires: rubygem(memcache-client) @@ -109,6 +110,12 @@ popd %doc %{gem_instdir}/contrib %changelog +* Sun Sep 28 2025 changtao - 1:2.2.4-13 +- Type:CVES +- ID:CVE-2025-59830 +- SUG:NA +- DESC:CVE-2025-59830 + * Wed Aug 20 2025 zouzhimin - 1:2.2.4-12 - Type:CVES - ID:CVE-2025-46727