public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/erlang-cowboy] f44: Backport fix for CVE-2026-115701 (keep-alive memory-exhaustion DoS)
@ 2026-11-20 13:30 Peter Lemenkov
  0 siblings, 0 replies; only message in thread
From: Peter Lemenkov @ 2026-11-20 13:30 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/erlang-cowboy
            Branch : f44
            Commit : 87e4e86966a8ffb59a246ee420bcaa37e3769114
            Author : Peter Lemenkov <lemenkov@gmail.com>
            Date   : 2026-11-20T14:30:37+01:00
            Stats  : +37/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/erlang-cowboy/c/87e4e86966a8ffb59a246ee420bcaa37e3769114?branch=f44

            Log:
            Backport fix for CVE-2026-115701 (keep-alive memory-exhaustion DoS)

Applies upstream cowboy commit 3a630c07e1521abf63a1b9ea080509aa1337b60d (released in 2.21.0): stop buffering pipelined HTTP/1 data while a request is in progress, so a slow handler can no longer be fed an unbounded keep-alive buffer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

---
diff --git a/cowboy-CVE-2026-115701.patch b/cowboy-CVE-2026-115701.patch
new file mode 100644
index 0000000..8984570
--- /dev/null
+++ b/cowboy-CVE-2026-115701.patch
@@ -0,0 +1,34 @@
+--- a/src/cowboy_http.erl
++++ b/src/cowboy_http.erl
+@@ -273,7 +273,13 @@
+ 		{Passive, Socket} when Passive =:= element(4, Messages);
+ 				%% Hardcoded for compatibility with Ranch 1.x.
+ 				Passive =:= tcp_passive; Passive =:= ssl_passive ->
+-			safe_setopts_active(State),
++			%% A leftover passive message would undo passive/1.
++			case State#state.active of
++				true ->
++					safe_setopts_active(State);
++				false ->
++					ok
++			end,
+ 			before_loop(State);
+ 		%% Timeouts.
+ 		{timeout, Ref, {shutdown, Pid}} ->
+@@ -389,6 +395,7 @@
+ 	terminate(State, {connection_error, timeout,
+ 		'Connection idle longer than configuration allows.'}).
+ 
++%% Empty buffer stays active so tcp_closed/ssl_closed still arrive.
+ parse(<<>>, State) ->
+ 	before_loop(State#state{buffer= <<>>});
+ %% Do not process requests that come in after the last request
+@@ -399,7 +406,7 @@
+ 	before_loop(State#state{buffer= <<>>});
+ %% Delay parsing pipelined requests until current stream stops.
+ parse(Buffer, State=#state{in_state=ps_next_request, stream=#stream{}}) ->
+-	before_loop(State#state{buffer=Buffer});
++	before_loop(passive(State#state{buffer=Buffer}));
+ parse(Buffer, State=#state{in_state=ps_next_request, stream=undefined}) ->
+ 	next_request(State#state{buffer=Buffer});
+ parse(Buffer, State=#state{in_state=#ps_request_line{empty_lines=EmptyLines}}) ->

diff --git a/erlang-cowboy.spec b/erlang-cowboy.spec
index 80dabb3..51bf9b3 100644
--- a/erlang-cowboy.spec
+++ b/erlang-cowboy.spec
@@ -9,6 +9,9 @@ License:	ISC
 URL:		https://github.com/ninenines/%{realname}
 VCS:		git:%{url}.git
 Source0:	%{url}/archive/%{version}/%{realname}-%{version}.tar.gz
+# Backport fix for CVE-2026-115701 (keep-alive connection memory-exhaustion DoS).
+# Upstream commit 3a630c07e1521abf63a1b9ea080509aa1337b60d (released in 2.21.0).
+Patch0:		cowboy-CVE-2026-115701.patch
 BuildRequires:	erlang-cowlib
 BuildRequires:	erlang-ct_helper
 BuildRequires:	erlang-gun

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-20 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 13:30 [rpms/erlang-cowboy] f44: Backport fix for CVE-2026-115701 (keep-alive memory-exhaustion DoS) Peter Lemenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox