diff --git a/Fix-CVE-2024-26141.patch b/Fix-CVE-2024-26141.patch new file mode 100644 index 0000000000000000000000000000000000000000..c388ec35d2bf3b2626f39c9912df10cff5b90f0c --- /dev/null +++ b/Fix-CVE-2024-26141.patch @@ -0,0 +1,30 @@ +From 72ecb3f4e05b2fc0a5073d23fd178686818eb958 Mon Sep 17 00:00:00 2001 +From: Aaron Patterson +Date: Tue, 13 Feb 2024 13:34:34 -0800 +Subject: [PATCH] Return an empty array when ranges are too large + +If the sum of the requested ranges is larger than the file itself, +return an empty array. In other words, refuse to respond with any bytes. + +[CVE-2024-26141] +--- + lib/rack/utils.rb | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb +index ca6182c..199312f 100644 +--- a/lib/rack/utils.rb ++++ b/lib/rack/utils.rb +@@ -379,6 +379,9 @@ module Rack + end + ranges << (r0..r1) if r0 <= r1 + end ++ ++ return [] if ranges.map(&:size).sum > size ++ + ranges + end + +-- +2.43.0 + diff --git a/rubygem-rack.spec b/rubygem-rack.spec index 7bf9359341112510a4ef9a562917c331d5a3b4ed..db370e914d8317d5d6ca7fe579b4bc330f80995c 100644 --- a/rubygem-rack.spec +++ b/rubygem-rack.spec @@ -4,13 +4,14 @@ Name: rubygem-%{gem_name} Version: 2.2.4 Epoch: 1 -Release: 1 +Release: 2 Summary: A modular Ruby webserver interface License: MIT and BSD URL: https://rack.github.io/ Source0: https://rubygems.org/downloads/%{gem_name}-%{version}.gem Patch0: 2-2-multipart-dos.patch Patch1: 2-2-header-redos.patch +Patch2: Fix-CVE-2024-26141.patch BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 BuildRequires: memcached rubygem(memcache-client) rubygem(minitest) BuildRequires: rubygem(memcache-client) @@ -41,9 +42,7 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -n %{gem_name}-%{version} -%patch0 -p1 -%patch1 -p1 +%autosetup -n %{gem_name}-%{version} -p1 -S git %build gem build ../%{gem_name}-%{version}.gemspec @@ -101,6 +100,12 @@ popd %doc %{gem_instdir}/contrib %changelog +* Mon Apr 01 2024 zouzhimin - 1:2.2.4-2 +- Type:CVES +- ID:CVE-2024-26141 +- SUG:NA +- DESC:CVE-2024-26141 + * Thu Aug 17 2023 wulei - 1:2.2.4-1 - Upgrade to version 2.2.4