Skip to content

Commit 8a54e6b

Browse files
[AUTO-CHERRYPICK] Patch fluent-bit for CVE-2024-50608 [HIGH] and CVE-2024-50609 [HIGH] - branch 3.0-dev (#12710)
Co-authored-by: kgodara912 <[email protected]>
1 parent 06d5e28 commit 8a54e6b

File tree

3 files changed

+119
-1
lines changed

3 files changed

+119
-1
lines changed

SPECS/fluent-bit/CVE-2024-50608.patch

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From 76a68e4c23cbc0c0d8f4fd41577ae217d20aeee2 Mon Sep 17 00:00:00 2001
2+
From: Eduardo Silva <[email protected]>
3+
Date: Sun, 23 Feb 2025 21:25:00 -0600
4+
Subject: [PATCH 1/2] in_prometheus_remote_write: fix handling of
5+
content-length (CVE-2024-50608)
6+
7+
Upstream Patch Reference:
8+
https://github.com/fluent/fluent-bit/pull/9993
9+
10+
Signed-off-by: Eduardo Silva <[email protected]>
11+
---
12+
.../in_prometheus_remote_write/prom_rw_prot.c | 18 +++++++++++++++++-
13+
1 file changed, 17 insertions(+), 1 deletion(-)
14+
15+
diff --git a/plugins/in_prometheus_remote_write/prom_rw_prot.c b/plugins/in_prometheus_remote_write/prom_rw_prot.c
16+
index d041c8f..8460c7f 100644
17+
--- a/plugins/in_prometheus_remote_write/prom_rw_prot.c
18+
+++ b/plugins/in_prometheus_remote_write/prom_rw_prot.c
19+
@@ -345,6 +345,13 @@ int prom_rw_prot_handle(struct flb_prom_remote_write *ctx,
20+
return -1;
21+
}
22+
23+
+ if (request->data.data == NULL || request->data.len <= 0) {
24+
+ flb_sds_destroy(tag);
25+
+ mk_mem_free(uri);
26+
+ send_response(ctx->ins, conn, 400, "error: no payload found\n");
27+
+ return -1;
28+
+ }
29+
+
30+
original_data = request->data.data;
31+
original_data_size = request->data.len;
32+
33+
@@ -466,13 +473,22 @@ int prom_rw_prot_handle_ng(struct flb_http_request *request,
34+
/* HTTP/1.1 needs Host header */
35+
if (request->protocol_version == HTTP_PROTOCOL_HTTP1 &&
36+
request->host == NULL) {
37+
-
38+
return -1;
39+
}
40+
41+
if (request->method != HTTP_METHOD_POST) {
42+
send_response_ng(response, 400, "error: invalid HTTP method\n");
43+
+ return -1;
44+
+ }
45+
+
46+
+ /* check content-length */
47+
+ if (request->content_length <= 0) {
48+
+ send_response_ng(response, 400, "error: invalid content-length\n");
49+
+ return -1;
50+
+ }
51+
52+
+ if (request->body == NULL) {
53+
+ send_response_ng(response, 400, "error: invalid payload\n");
54+
return -1;
55+
}
56+
57+
--
58+
2.48.1.431.g5a526e5e18
59+

SPECS/fluent-bit/CVE-2024-50609.patch

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From ce99c23a61cea708c2d5093031bdade0a620595a Mon Sep 17 00:00:00 2001
2+
From: Eduardo Silva <[email protected]>
3+
Date: Sun, 23 Feb 2025 21:24:10 -0600
4+
Subject: [PATCH 2/2] in_opentelemetry: fix handling of content-length
5+
(CVE-2024-50609)
6+
7+
Upstream Patch Reference:
8+
https://github.com/fluent/fluent-bit/pull/9993
9+
10+
Signed-off-by: Eduardo Silva <[email protected]>
11+
---
12+
plugins/in_opentelemetry/opentelemetry_prot.c | 19 +++++++++++++++++++
13+
1 file changed, 19 insertions(+)
14+
15+
diff --git a/plugins/in_opentelemetry/opentelemetry_prot.c b/plugins/in_opentelemetry/opentelemetry_prot.c
16+
index c1a45c4..2b40e09 100644
17+
--- a/plugins/in_opentelemetry/opentelemetry_prot.c
18+
+++ b/plugins/in_opentelemetry/opentelemetry_prot.c
19+
@@ -1893,6 +1893,13 @@ int opentelemetry_prot_handle(struct flb_opentelemetry *ctx, struct http_conn *c
20+
original_data = request->data.data;
21+
original_data_size = request->data.len;
22+
23+
+ if (request->data.len <= 0) {
24+
+ flb_sds_destroy(tag);
25+
+ mk_mem_free(uri);
26+
+ send_response(conn, 400, "error: no payload found\n");
27+
+ return -1;
28+
+ }
29+
+
30+
ret = opentelemetry_prot_uncompress(session, request,
31+
&uncompressed_data,
32+
&uncompressed_data_size);
33+
@@ -2462,6 +2469,18 @@ int opentelemetry_prot_handle_ng(struct flb_http_request *request,
34+
return -1;
35+
}
36+
37+
+ /* check content-length */
38+
+ if (request->content_length <= 0) {
39+
+ send_response_ng(response, 400, "error: invalid content-length\n");
40+
+ return -1;
41+
+ }
42+
+
43+
+ if (request->body == NULL) {
44+
+ send_response_ng(response, 400, "error: invalid payload\n");
45+
+ return -1;
46+
+ }
47+
+
48+
+
49+
if (strcmp(request->path, "/v1/metrics") == 0 ||
50+
strcmp(request->path, "/opentelemetry.proto.collector.metric.v1.MetricService/Export") == 0 ||
51+
strcmp(request->path, "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export") == 0) {
52+
--
53+
2.48.1.431.g5a526e5e18
54+

SPECS/fluent-bit/fluent-bit.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Fast and Lightweight Log processor and forwarder for Linux, BSD and OSX
22
Name: fluent-bit
33
Version: 3.1.9
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: Apache-2.0
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -10,6 +10,8 @@ Source0: https://github.com/fluent/%{name}/archive/refs/tags/v%{version}.
1010
Patch0: CVE-2024-34250.patch
1111
Patch1: CVE-2024-25431.patch
1212
Patch2: CVE-2024-27532.patch
13+
Patch3: CVE-2024-50608.patch
14+
Patch4: CVE-2024-50609.patch
1315
BuildRequires: bison
1416
BuildRequires: cmake
1517
BuildRequires: cyrus-sasl-devel
@@ -84,6 +86,9 @@ Development files for %{name}
8486
%{_libdir}/fluent-bit/*.so
8587

8688
%changelog
89+
* Wed Feb 26 2025 Kshitiz Godara <[email protected]> - 3.1.9-3
90+
- Address CVE-2024-50608 and CVE-2024-50609
91+
8792
* Tue Dec 10 2024 Sudipta Pandit <[email protected]> - 3.1.9-2
8893
- Backport fixes for CVE-2024-27532
8994

0 commit comments

Comments
 (0)