Skip to content

Commit dc5da04

Browse files
authored
[2.0] Resolve telegraf CVE-2024-27289 (#9235)
Co-authored-by: Henry Li <lihl@microsoft.com>
1 parent c5d244f commit dc5da04

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go b/vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go
2+
index 5eef456..4c345d5 100644
3+
--- a/vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go
4+
+++ b/vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go
5+
@@ -58,6 +58,10 @@ func (q *Query) Sanitize(args ...interface{}) (string, error) {
6+
return "", fmt.Errorf("invalid arg type: %T", arg)
7+
}
8+
argUse[argIdx] = true
9+
+
10+
+ // Prevent SQL injection via Line Comment Creation
11+
+ // https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p
12+
+ str = "(" + str + ")"
13+
default:
14+
return "", fmt.Errorf("invalid Part type: %T", part)
15+
}

SPECS/telegraf/telegraf.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: agent for collecting, processing, aggregating, and writing metrics.
22
Name: telegraf
33
Version: 1.29.4
4-
Release: 3%{?dist}
4+
Release: 4%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -12,6 +12,7 @@ Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1212
Source1: %{name}-%{version}-vendor.tar.gz
1313
Patch0: CVE-2023-45288.patch
1414
Patch1: CVE-2024-28110.patch
15+
Patch2: CVE-2024-27289.patch
1516
BuildRequires: golang
1617
BuildRequires: iana-etc
1718
BuildRequires: systemd-devel
@@ -82,6 +83,9 @@ fi
8283
%dir %{_sysconfdir}/%{name}/telegraf.d
8384

8485
%changelog
86+
* Fri May 24 2024 Henry Li <lihl@microsoft.com> - 1.29.4-4
87+
- Add patch to resolve CVE-2024-27289
88+
8589
* Mon May 06 2024 Henry Li <lihl@microsoft.com> - 1.29.4-3
8690
- Re-add patch for CVE-2024-28110
8791

0 commit comments

Comments
 (0)