Version in base suite: 7.74.0-1.3+deb11u11 Base version: curl_7.74.0-1.3+deb11u11 Target version: curl_7.74.0-1.3+deb11u12 Base file: /srv/ftp-master.debian.org/ftp/pool/main/c/curl/curl_7.74.0-1.3+deb11u11.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/c/curl/curl_7.74.0-1.3+deb11u12.dsc changelog | 9 ++++ patches/CVE-2024-2398.patch | 88 ++++++++++++++++++++++++++++++++++++++++++++ patches/series | 3 + 3 files changed, 100 insertions(+) diff -Nru curl-7.74.0/debian/changelog curl-7.74.0/debian/changelog --- curl-7.74.0/debian/changelog 2023-12-10 06:05:18.000000000 +0000 +++ curl-7.74.0/debian/changelog 2024-04-10 01:00:20.000000000 +0000 @@ -1,3 +1,12 @@ +curl (7.74.0-1.3+deb11u12) bullseye; urgency=medium + + * Team upload. + * Import patch to fix CVE-2024-2398: Memory leak when HTTP/2 server push is + aborted. + * d/p/CVE-2024-2398.patch: Backport patch. + + -- Guilherme Puida Moreira Tue, 09 Apr 2024 22:00:20 -0300 + curl (7.74.0-1.3+deb11u11) bullseye-security; urgency=high * Add patch to fix CVE-2023-46218 diff -Nru curl-7.74.0/debian/patches/CVE-2024-2398.patch curl-7.74.0/debian/patches/CVE-2024-2398.patch --- curl-7.74.0/debian/patches/CVE-2024-2398.patch 1970-01-01 00:00:00.000000000 +0000 +++ curl-7.74.0/debian/patches/CVE-2024-2398.patch 2024-04-10 01:00:20.000000000 +0000 @@ -0,0 +1,88 @@ +From deca8039991886a559b67bcd6701db800a5cf764 Mon Sep 17 00:00:00 2001 +From: Stefan Eissing +Date: Wed, 6 Mar 2024 09:36:08 +0100 +Subject: [PATCH] http2: push headers better cleanup + +- provide common cleanup method for push headers + +Closes #13054 + +Backported by: Guilherme Puida Moreira : + * Changed h2_stream_ctx to HTTP in free_push_headers. + * Dropped unnaplicable hunk in push_promise, since it changed some code + that does not yet exist. +--- + lib/http2.c | 34 +++++++++++++++------------------- + 1 file changed, 15 insertions(+), 19 deletions(-) + +Index: curl/lib/http2.c +=================================================================== +--- curl.orig/lib/http2.c ++++ curl/lib/http2.c +@@ -155,6 +155,15 @@ static CURLcode http2_disconnect(struct + return CURLE_OK; + } + ++static void free_push_headers(struct HTTP *stream) ++{ ++ size_t i; ++ for(i = 0; ipush_headers_used; i++) ++ free(stream->push_headers[i]); ++ Curl_safefree(stream->push_headers); ++ stream->push_headers_used = 0; ++} ++ + /* + * The server may send us data at any point (e.g. PING frames). Therefore, + * we cannot assume that an HTTP/2 socket is dead just because it is readable. +@@ -525,7 +534,6 @@ static int push_promise(struct Curl_easy + struct curl_pushheaders heads; + CURLMcode rc; + struct http_conn *httpc; +- size_t i; + /* clone the parent */ + struct Curl_easy *newhandle = duphandle(data); + if(!newhandle) { +@@ -560,11 +568,7 @@ static int push_promise(struct Curl_easy + Curl_set_in_callback(data, false); + + /* free the headers again */ +- for(i = 0; ipush_headers_used; i++) +- free(stream->push_headers[i]); +- free(stream->push_headers); +- stream->push_headers = NULL; +- stream->push_headers_used = 0; ++ free_push_headers(stream); + + if(rv) { + DEBUGASSERT((rv > CURL_PUSH_OK) && (rv <= CURL_PUSH_ERROROUT)); +@@ -1001,10 +1005,10 @@ static int on_header(nghttp2_session *se + stream->push_headers_alloc) { + char **headp; + stream->push_headers_alloc *= 2; +- headp = Curl_saferealloc(stream->push_headers, +- stream->push_headers_alloc * sizeof(char *)); ++ headp = realloc(stream->push_headers, ++ stream->push_headers_alloc * sizeof(char *)); + if(!headp) { +- stream->push_headers = NULL; ++ free_push_headers(stream); + return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; + } + stream->push_headers = headp; +@@ -1170,14 +1174,7 @@ void Curl_http2_done(struct Curl_easy *d + setup */ + Curl_dyn_free(&http->header_recvbuf); + Curl_dyn_free(&http->trailer_recvbuf); +- if(http->push_headers) { +- /* if they weren't used and then freed before */ +- for(; http->push_headers_used > 0; --http->push_headers_used) { +- free(http->push_headers[http->push_headers_used - 1]); +- } +- free(http->push_headers); +- http->push_headers = NULL; +- } ++ free_push_headers(http); + + if(!(data->conn->handler->protocol&PROTO_FAMILY_HTTP) || + !httpc->h2) /* not HTTP/2 ? */ diff -Nru curl-7.74.0/debian/patches/series curl-7.74.0/debian/patches/series --- curl-7.74.0/debian/patches/series 2023-12-10 06:05:18.000000000 +0000 +++ curl-7.74.0/debian/patches/series 2024-04-10 01:00:20.000000000 +0000 @@ -48,6 +48,9 @@ # Patches from 8.5.0. CVE-2023-46218.patch +# Patches from 8.7.0. +CVE-2024-2398.patch + # Always add CVE patches before these two patches 90_gnutls.patch 99_nss.patch