[packages/asterisk/ASTERISK_18] Rel 4. Backport high-severity security fixes from 20.20.1

arekm arekm at pld-linux.org
Sun Nov 8 03:33:59 CET 2026


commit 9b2d10915952c15bf2d9cea56df4fe675238bc71
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Nov 8 03:33:02 2026 +0100

    Rel 4. Backport high-severity security fixes from 20.20.1
    
    Fixes CVE-2026-57202, CVE-2026-57191, CVE-2026-57188,
    CVE-2026-57187, CVE-2026-57185.
    
    Pin --without-libjwt so res_stir_shaken is not autodetected.

 CVE-2026-57185.patch | 45 +++++++++++++++++++++++++++++++++++++++++
 CVE-2026-57187.patch | 41 ++++++++++++++++++++++++++++++++++++++
 CVE-2026-57188.patch | 37 ++++++++++++++++++++++++++++++++++
 CVE-2026-57191.patch | 36 +++++++++++++++++++++++++++++++++
 CVE-2026-57202.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 asterisk.spec        | 14 ++++++++++++-
 6 files changed, 228 insertions(+), 1 deletion(-)
---
diff --git a/asterisk.spec b/asterisk.spec
index 9eea9f1..dfed124 100644
--- a/asterisk.spec
+++ b/asterisk.spec
@@ -52,7 +52,7 @@ Summary:	Asterisk PBX
 Summary(pl.UTF-8):	Centralka (PBX) Asterisk
 Name:		asterisk
 Version:	18.26.4
-Release:	3
+Release:	4
 License:	GPL v2
 Group:		Applications/System
 Source0:	https://downloads.asterisk.org/pub/telephony/asterisk/releases/%{name}-%{version}.tar.gz
@@ -79,6 +79,12 @@ Patch5:		x32.patch
 # backport from 6ac1bb93afed, never released for the EOL 18 branch
 Patch6:		libical4.patch
 #Patch7:		%{name}-ilbc.patch
+# high-severity fixes from 20.20.1 for built modules, never released for 18
+Patch100:	CVE-2026-57185.patch
+Patch101:	CVE-2026-57187.patch
+Patch102:	CVE-2026-57188.patch
+Patch103:	CVE-2026-57191.patch
+Patch104:	CVE-2026-57202.patch
 URL:		http://www.asterisk.org/
 BuildRequires:	OSPToolkit-devel >= 4.0.0
 %{?with_oss:BuildRequires:	SDL-devel}
@@ -776,6 +782,11 @@ Dokumentacja API Asteriska.
 %patch -P4 -p1
 %patch -P5 -p1
 %patch -P6 -p1
+%patch -P100 -p1
+%patch -P101 -p1
+%patch -P102 -p1
+%patch -P103 -p1
+%patch -P104 -p1
 
 %if %{with opus_vp8}
 # take only the modules Asterisk itself lacks; its own res_format_attr_opus.c
@@ -825,6 +836,7 @@ cd ..
 	ac_cv_header_stdc=yes \
 	%{__without_if system_pjproject pjproject-bundled} \
 	--without-jansson-bundled \
+	--without-libjwt \
 	--with-unbound \
 	%{__without oss SDL_image} \
 	%{__without bluetooth bluetooth} \
diff --git a/CVE-2026-57185.patch b/CVE-2026-57185.patch
new file mode 100644
index 0000000..5acf30c
--- /dev/null
+++ b/CVE-2026-57185.patch
@@ -0,0 +1,45 @@
+From 57ce484a45b098de417f19265c95c64497782e36 Mon Sep 17 00:00:00 2001
+From: Roberto Paleari <r.paleari at reply.it>
+Date: Wed, 29 Apr 2026 14:18:31 +0200
+Subject: [PATCH] res/res_pjsip_pubsub.c: Fix buffer over-read in MWI body
+ parser
+
+Add constraint checks to prevent unauthenticated users from crashing Asterisk
+instance by sending a crafted inbound SIP NOTIFY request with "Content-Type:
+application/simple-message-summary".
+
+Resolves: #GHSA-8jw3-ccr9-xrmf
+---
+ res/res_pjsip_pubsub.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
+index 9bab0d6423df596b5359b1ad1040a4e98e6f7641..299cab2d2fd81b0d1e709e29a2bff427965ee091 100644
+--- a/res/res_pjsip_pubsub.c
++++ b/res/res_pjsip_pubsub.c
+@@ -3663,6 +3663,7 @@ static pj_bool_t pubsub_on_rx_mwi_notify_request(pjsip_rx_data *rdata)
+ 	char *context;
+ 	char *body;
+ 	char *mailbox;
++	int body_len;
+ 	int rc;
+ 
+ 	endpoint = ast_pjsip_rdata_get_endpoint(rdata);
+@@ -3695,9 +3696,16 @@ static pj_bool_t pubsub_on_rx_mwi_notify_request(pjsip_rx_data *rdata)
+ 	context = atsign + 1;
+ 
+ 	body = ast_alloca(rdata->msg_info.msg->body->len + 1);
+-	rdata->msg_info.msg->body->print_body(rdata->msg_info.msg->body, body,
++	body_len = rdata->msg_info.msg->body->print_body(rdata->msg_info.msg->body, body,
+ 		rdata->msg_info.msg->body->len + 1);
+ 
++	if (body_len < 0 || body_len > rdata->msg_info.msg->body->len) {
++		ast_debug(1, "Incoming MWI: Endpoint: '%s' Unable to print request body\n", endpoint_name);
++		rc = 404;
++		goto error;
++	}
++	body[body_len] = '\0';
++
+ 	if (parse_simple_message_summary(body, &summary) != 0) {
+ 		ast_debug(1, "Incoming MWI: Endpoint: '%s' There was an issue getting message info from body '%s'\n",
+ 			ast_sorcery_object_get_id(endpoint), body);
diff --git a/CVE-2026-57187.patch b/CVE-2026-57187.patch
new file mode 100644
index 0000000..300da94
--- /dev/null
+++ b/CVE-2026-57187.patch
@@ -0,0 +1,41 @@
+From b7ba85458796ef54b471017287c7806095dbda76 Mon Sep 17 00:00:00 2001
+From: George Joseph <gjoseph at sangoma.com>
+Date: Wed, 10 Jun 2026 17:07:07 -0600
+Subject: [PATCH] pjsip_message_filter: Use pj_strdup instead of pj_strassign
+ to save local address.
+
+The filter_on_tx_message() function was using pj_strassign() to save the pointer
+of the pjproject transport local address to a local pj_str_t variable.  That
+variable was ultimately used to set the Contact header's uri->host and the SDP
+connection attribute's address again using pj_strassign.  pj_strassign() doesn't
+copy the actual value of the pj_str_t however, it just copies the pointer so
+if a connection-oriented transport is disconnected before the 200 OK with the
+SDP is sent, those pointers will be invalid which can cause use-after-free
+issues. To prevent this, filter_on_tx_message() now uses pj_strdup with the
+tdata->pool as the backing store to save the local IP address to the local
+variable.  pj_strassign() can then be used safely later on since the tdata
+will be available for the life of the transaction.
+
+Resolves: #GHSA-g8q2-p36q-94f6
+---
+ res/res_pjsip/pjsip_message_filter.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/res/res_pjsip/pjsip_message_filter.c b/res/res_pjsip/pjsip_message_filter.c
+index 7f1b7d736c1972bb25205a489c58f390e5a25791..4b7a5be75e002fb84c65ab67bc889597d6608422 100644
+--- a/res/res_pjsip/pjsip_message_filter.c
++++ b/res/res_pjsip/pjsip_message_filter.c
+@@ -277,11 +277,11 @@ static pj_status_t filter_on_tx_message(pjsip_tx_data *tdata)
+ 
+ 		/* If the chosen transport is not bound to any we can't use the source address as it won't get back to us */
+ 		if (!is_bound_any(tdata->tp_info.transport)) {
+-			pj_strassign(&prm.ret_addr, &tdata->tp_info.transport->local_name.host);
++			pj_strdup(tdata->pool, &prm.ret_addr, &tdata->tp_info.transport->local_name.host);
+ 		}
+ 	} else {
+ 		/* The transport chosen will deliver this but ensure it is updated with the right information */
+-		pj_strassign(&prm.ret_addr, &tdata->tp_info.transport->local_name.host);
++		pj_strdup(tdata->pool, &prm.ret_addr, &tdata->tp_info.transport->local_name.host);
+ 	}
+ 
+ 	/* If the message needs to be updated with new address do so */
diff --git a/CVE-2026-57188.patch b/CVE-2026-57188.patch
new file mode 100644
index 0000000..8908782
--- /dev/null
+++ b/CVE-2026-57188.patch
@@ -0,0 +1,37 @@
+From 3c4b08cf94eeaa3faefb3ae6c2d6ce1bd9747a13 Mon Sep 17 00:00:00 2001
+From: Milan Kyselica <mil.kyselica at gmail.com>
+Date: Thu, 26 Mar 2026 15:48:28 +0100
+Subject: [PATCH] res_xmpp: Fix stack buffer overflow in namespace prefix
+ handling
+
+The snprintf size parameter in xmpp_action_hook() is computed from
+the attacker-controlled namespace prefix length and is not bounded
+by the 256-byte stack buffer size. When a remote XMPP peer sends a
+stanza with a child element whose namespace prefix exceeds 249
+characters, snprintf writes past the buffer boundary.
+
+Use sizeof(attr) as the snprintf size limit and %.*s precision to
+extract only the prefix portion of the element name, preserving
+the original truncation behavior for valid inputs.
+
+Resolves: #GHSA-mxgm-8c6f-5p8f
+---
+ res/res_xmpp.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/res/res_xmpp.c b/res/res_xmpp.c
+index 1003dde015dc76c8f348a1499a022ca5ce2343f3..a49c3d235e4cfdbbb0c0b722c5622cf09ffbe2ee 100644
+--- a/res/res_xmpp.c
++++ b/res/res_xmpp.c
+@@ -3483,8 +3483,9 @@ static int xmpp_action_hook(void *data, int type, iks *node)
+ 		char *node_ns = NULL;
+ 		char attr[XMPP_MAX_ATTRLEN];
+ 		char *node_name = iks_name(iks_child(node));
+-		char *aux = strchr(node_name, ':') + 1;
+-		snprintf(attr, strlen("xmlns:") + (strlen(node_name) - strlen(aux)), "xmlns:%s", node_name);
++		char *colon = strchr(node_name, ':');
++		snprintf(attr, sizeof(attr), "xmlns:%.*s",
++			(int)(colon - node_name), node_name);
+ 		node_ns = iks_find_attrib(iks_child(node), attr);
+ 		if (node_ns) {
+ 			pak->ns = node_ns;
diff --git a/CVE-2026-57191.patch b/CVE-2026-57191.patch
new file mode 100644
index 0000000..6304655
--- /dev/null
+++ b/CVE-2026-57191.patch
@@ -0,0 +1,36 @@
+From dca516f6d895e8867d48fa56b6ce7f05b6f7457a Mon Sep 17 00:00:00 2001
+From: Milan Kyselica <mil.kyselica at gmail.com>
+Date: Tue, 24 Mar 2026 19:22:02 +0100
+Subject: [PATCH] res_pjsip_pubsub: Add width limit to sscanf in MWI NOTIFY
+ parser
+
+The parse_simple_message_summary() function uses sscanf with an
+unbounded %s format specifier to parse the Message-Account field
+from incoming SIP NOTIFY bodies into a fixed-size 512-byte stack
+buffer (PJSIP_MAX_URL_SIZE). A single unauthenticated SIP NOTIFY
+with a Message-Account value exceeding 512 bytes overflows the
+buffer, corrupting adjacent stack data and permanently disabling
+the PJSIP transport layer without crashing the process.
+
+Add a width specifier (%511s) to limit the sscanf write to
+PJSIP_MAX_URL_SIZE - 1 bytes plus the NUL terminator, matching
+the destination buffer size.
+
+Resolves: #GHSA-589g-qgf8-m6mx
+---
+ res/res_pjsip_pubsub.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
+index 299cab2d2fd81b0d1e709e29a2bff427965ee091..03d6ee9246c020ae47e99d1daf06d661e04d509e 100644
+--- a/res/res_pjsip_pubsub.c
++++ b/res/res_pjsip_pubsub.c
+@@ -3647,7 +3647,7 @@ static int parse_simple_message_summary(char *body,
+ 			&summary->voice_messages_urgent_new, &summary->voice_messages_urgent_old)) {
+ 			found_counts = 1;
+ 		} else {
+-			sscanf(line, "message-account: %s", summary->message_account);
++			sscanf(line, "message-account: %511s", summary->message_account);
+ 		}
+ 	}
+ 
diff --git a/CVE-2026-57202.patch b/CVE-2026-57202.patch
new file mode 100644
index 0000000..5854be1
--- /dev/null
+++ b/CVE-2026-57202.patch
@@ -0,0 +1,56 @@
+From ba04e7f1f98887c3c6e0dc4ddce663021f7e948a Mon Sep 17 00:00:00 2001
+From: George Joseph <gjoseph at sangoma.com>
+Date: Thu, 21 May 2026 07:55:01 -0600
+Subject: [PATCH] ARI: Make ARI applications respect live_dangerously.
+
+DeveloperNote: ARI applications can no longer call "dangerous" dialplan
+functions like DB(), FILE(), SHELL(), CURL(), STAT(), etc. without
+enabling "live_dangerously" in asterisk.conf.
+
+Resolves: #GHSA-vrfp-mg3q-3959
+
+[PLD: refreshed for the 18.26.4 context]
+---
+ include/asterisk/stasis_app.h |  5 +++++
+ res/stasis/control.c          | 10 ++++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/include/asterisk/stasis_app.h b/include/asterisk/stasis_app.h
+index 9a01ef33c36ffe20532a7ec724ea7e681a5e71e3..548fb600f935f255ec5fceacefc47eef0e5af996 100644
+--- a/include/asterisk/stasis_app.h
++++ b/include/asterisk/stasis_app.h
+@@ -597,6 +597,11 @@ int stasis_app_control_answer(struct stasis_app_control *control);
+  * \param variable The name of the variable
+  * \param value The value to set the variable to
+  *
++ * \note The thread that actually does the set will have the inhibit_escalations
++ * flag set before the call to pbx_builtin_setvar_helper to prevent dangerous
++ * dialplan function execution from ARI.  The flag will be reset to its original
++ * state when pbx_builtin_setvar_helper returns.
++ *
+  * \return 0 for success.
+  * \return -1 for error.
+  */
+diff --git a/res/stasis/control.c b/res/stasis/control.c
+index dfbc007399f1f04049840e9e7c59752ba641d942..19ec7150efa8cfec6ca45668c5428a136accbe8e 100644
+--- a/res/stasis/control.c
++++ b/res/stasis/control.c
+@@ -711,8 +711,18 @@ static int app_control_set_channel_var(struct stasis_app_control *control,
+ 	struct ast_channel *chan, void *data)
+ {
+ 	struct chanvar *var = data;
++	/*
++	 * Save the current inhibit state then enable it.
++	 */
++	int inhibited = ast_thread_inhibit_escalations_swap(1);
+ 
+ 	pbx_builtin_setvar_helper(control->channel, var->name, var->value);
++	/*
++	 * Re-enable it if it was originally enabled.
++	 */
++	if (inhibited > 0) {
++		ast_thread_inhibit_escalations();
++	}
+ 
+ 	return 0;
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/asterisk.git/commitdiff/9b2d10915952c15bf2d9cea56df4fe675238bc71



More information about the pld-cvs-commit mailing list