Skip to content

Commit c9333cf

Browse files
CBL-Mariner-Botazurelinux-securitykevin-b-lockwood
authored
[AUTO-CHERRYPICK] [AutoPR- Security] Patch mtr for CVE-2025-49809 - branch 3.0-dev (microsoft#14301)
Co-authored-by: Azure Linux Security Servicing Account <[email protected]> Co-authored-by: Kevin Lockwood <[email protected]>
1 parent f5ffca9 commit c9333cf

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

SPECS/mtr/CVE-2025-49809.patch

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From de4cc71f2bca9ac59bed53ed5697147195d0226c Mon Sep 17 00:00:00 2001
2+
From: Azure Linux Security Servicing Account
3+
4+
Date: Mon, 14 Jul 2025 19:49:55 +0000
5+
Subject: [PATCH] Fix CVE CVE-2025-49809 in mtr
6+
7+
Upstream Patch Reference: https://github.com/traviscross/mtr/commit/5226f105f087c29d3cfad9f28000e7536af91ac6.patch
8+
---
9+
ui/cmdpipe.c | 13 ++++++++++---
10+
1 file changed, 10 insertions(+), 3 deletions(-)
11+
12+
diff --git a/ui/cmdpipe.c b/ui/cmdpipe.c
13+
index d22b236..1a66293 100644
14+
--- a/ui/cmdpipe.c
15+
+++ b/ui/cmdpipe.c
16+
@@ -220,10 +220,17 @@ void execute_packet_child(
17+
the path to the mtr-packet executable. This is necessary
18+
for debugging changes for mtr-packet.
19+
*/
20+
- char *mtr_packet_path = getenv("MTR_PACKET");
21+
- if (mtr_packet_path == NULL) {
22+
+ char * mtr_packet_path = NULL;
23+
+
24+
+ // In the rare case that mtr-packet is not setuid-root,
25+
+ // and a select group of users has sudo privileges to run
26+
+ // mtr and not much else, THEN create /etc/mtr.is.run.under.sudo
27+
+ // to prevent a privilege escalation when one of those accounts
28+
+ // is compromised. CVE-2025-49809
29+
+ if (access ("/etc/mtr.is.run.under.sudo", F_OK) != 0)
30+
+ mtr_packet_path = getenv("MTR_PACKET");
31+
+ if (mtr_packet_path == NULL)
32+
mtr_packet_path = "mtr-packet";
33+
- }
34+
35+
/*
36+
First, try to execute mtr-packet from PATH
37+
--
38+
2.45.3
39+

SPECS/mtr/mtr.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Network diagnostic tool combining 'traceroute' and 'ping'
44
Name: mtr
55
Version: 0.95
6-
Release: 2%{?dist}
6+
Release: 3%{?dist}
77
License: GPLv2
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
@@ -12,6 +12,7 @@ Source0: https://github.com/traviscross/mtr/archive/v%{version}/%{name}-%{versio
1212
Source1: net-x%{name}.desktop
1313
Source2: mtr-gtk-pkexec-wrapper.sh
1414
Source3: org.fedoraproject.mtr.policy
15+
Patch0:CVE-2025-49809.patch
1516

1617
BuildRequires: ncurses-devel
1718
BuildRequires: autoconf automake libtool git
@@ -32,7 +33,7 @@ command line, e.g. for SSH sessions; and a GTK+ interface for X (provided
3233
in the mtr-gtk package).
3334

3435
%prep
35-
%autosetup
36+
%autosetup -p1
3637

3738
%build
3839
export CFLAGS="%{optflags} -fPIE"
@@ -61,6 +62,9 @@ install -D -p -m 0755 mtr %{buildroot}%{_sbindir}/mtr
6162
%{_datadir}/bash-completion/completions/%{name}
6263

6364
%changelog
65+
* Mon Jul 14 2025 Azure Linux Security Servicing Account <[email protected]> - 0.95-3
66+
- Patch for CVE-2025-49809
67+
6468
* Mon Jul 22 2024 Aditya Dubey <[email protected]> - 0.95-2
6569
- Promoting package from SPECS-EXTENDED to SPECS
6670

0 commit comments

Comments
 (0)