Skip to contentSkip to conversation

rsyslog: Fix CVE-2026-55556

PATCH New Ashishkumar Parmar X (asparmar - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 2 messages Nov 24

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rsyslog: Fix CVE-2026-55556

From: Ashishkumar Parmar <[email protected]>

Backport the maintainer-recommended correction for the imhttp Basic Authentication buffer allocation. This protects builds that enable the recipe's optional imhttp PACKAGECONFIG; it is disabled by default.

Keep rsyslog at 8.2512.0 and preserve the existing authentication API.

Upstream fix:
https://github.com/rsyslog/rsyslog/commit/acde2ba25ea33816694b787859f4a727a247b6d6
Stable-branch backport guidance:
https://www.openwall.com/lists/oss-security/2026/06/23/4

---
 .../rsyslog/rsyslog/CVE-2026-55556.patch      | 72 +++++++++++++++++++
 .../rsyslog/rsyslog_8.2512.0.bb               |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-55556.patch
meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-55556.patch new file +72 -0
new file mode 100644
index 0000000000..a950d58a50
@@ -0,0 +1,72 @@
+From 8b9dbb6ddbc71fdbcd81e2b3b3d6f58dfde71adb Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <[email protected]>
+Date: Tue, 14 Apr 2026 07:55:43 +0000
+Subject: [PATCH] imhttp: add route-scoped API key authentication
+
+Why: Elastic Agent style HTTP ingestion needs a lighter auth mode
+than Basic auth, and imhttp also needs route-level flexibility for
+future endpoint-specific behavior.
+
+Impact: imhttp inputs, health checks, and metrics can now be run as
+no auth, Basic only, API key only, or Basic plus API key, with new
+shell and YAML regression coverage.
+
+Before/After: Basic auth was the only supported auth mode; imhttp
+now supports per-route API key auth and mixed auth selection.
+
+Technical Overview:
+Introduce a small route auth context so each registered CivetWeb
+handler can carry its own auth policy instead of relying on one
+module-wide Basic auth setting.
+
+Add apiKeyFile support for input endpoints plus matching
+healthCheckApiKeyFile and metricsApiKeyFile module settings.
+
+Accept API keys from Authorization: ApiKey and X-API-Key headers,
+with files parsed as one token per line while ignoring comments and
+blank lines.
+
+Trim leading whitespace for X-API-Key values and add an auth-header
+limits regression so oversized auth headers cannot silently bypass
+validation.
+
+Keep the implementation extensible for a larger route table so full
+Elasticsearch mock mode can build on the same registration path.
+
+Fix nearby imhttp defects worth addressing before further expansion,
+including safer auth parsing, better cleanup on partial failures,
+proper submit/flush error handling, and safer metadata string use.
+
+Document the new parameters and examples, and add focused shell and
+YAML tests for API-key and mixed-auth behavior.
+
+With the help of AI-Agents: Codex
+
+CVE: CVE-2026-55556
+Upstream-Status: Backport [https://github.com/rsyslog/rsyslog/commit/acde2ba25ea33816694b787859f4a727a247b6d6]
+
+Backport Changes:
+- Use the maintainer's one-line correction for the older Basic Auth
+  parser. The upstream commit replaces that parser as part of broader
+  route-scoped API-key authentication work.
+- Omit the API-key features, endpoint changes, documentation and test
+  changes belonging to that refactor. Preserve the existing auth API.
+
+Signed-off-by: Ashishkumar Parmar <[email protected]>
+---
+ contrib/imhttp/imhttp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/imhttp/imhttp.c b/contrib/imhttp/imhttp.c
+index 3b02e38..2d26fab 100644
+--- a/contrib/imhttp/imhttp.c
++++ b/contrib/imhttp/imhttp.c
+@@ -699,7 +699,7 @@ static int parse_auth_header(struct mg_connection *conn, struct auth_s *auth) {
+     size_t len = apr_base64_decode_len((const char *)src);
+     auth->pworkbuf = auth->workbuf;
+     if (len > sizeof(auth->workbuf)) {
+-        auth->pworkbuf = calloc(0, len);
++        auth->pworkbuf = calloc(1, len);
+         auth->workbuf_len = len;
+     }
+     len = apr_base64_decode(auth->pworkbuf, src);
meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb +1 -0
index 5ab4a65e67..f132f4a764 100644
@@ -27,6 +27,7 @@ SRC_URI = "https://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \
            file://0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch \
            file://CVE-2026-19654.patch \
            file://CVE-2026-19654-regression.patch \
+           file://CVE-2026-55556.patch \
 "
 
 SRC_URI:append:libc-musl = " \
Signature · 1 line
2.35.6
#1 lore raw

PATCH 2/2 rsyslog: Fix CVE-2026-61548

From: Ashishkumar Parmar <[email protected]>

Backport the targeted mmpstrucdata parameter-buffer correction recommended by the rsyslog maintainer for stable branches. Replace the fixed stack buffer with an allocation bounded by the input length and free it on all exit paths, preserving rsyslog 8.2512.0 APIs.

Keep the cached structured-data length wide enough for messages above 64 KiB so buffer sizing uses the complete input length.

mmpstrucdata is not enabled by the stock recipe. This source correction also covers downstream builds that explicitly enable the module and configure it to parse large structured-data messages.

Upstream fix:
https://github.com/rsyslog/rsyslog/commit/bcda60a3692efdf0c8e44102528f5a0ebe0dec6d
Stable-branch backport guidance:
https://www.openwall.com/lists/oss-security/2026/07/20/1

---
 .../rsyslog/rsyslog/CVE-2026-61548.patch      | 101 ++++++++++++++++++
 .../rsyslog/rsyslog_8.2512.0.bb               |   1 +
 2 files changed, 102 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-61548.patch
meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-61548.patch new file +101 -0
new file mode 100644
index 0000000000..edd31769b3
@@ -0,0 +1,101 @@
+From d68f0cb23e368c3609e9aa67c877ac0395d5d6a3 Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <[email protected]>
+Date: Tue, 2 Jun 2026 12:00:15 +0000
+Subject: [PATCH] mmpstrucdata: support custom SD containers
+
+Why:
+Operators need parsed RFC5424 structured data below a predictable
+JSON object name, and old large structured-data messages could exceed
+module-local assumptions.
+
+Impact:
+Adds two action parameters, expands structured-data length storage,
+and enables mmpstrucdata in the Ubuntu 26.04 TSAN lane.
+
+Before/After:
+Before, mmpstrucdata always wrote `rfc5424-sd` and could fail on very
+large SD. After, the container is configurable and SD size is bounded.
+
+Technical Overview:
+- Add `container` with default `rfc5424-sd`.
+- Add `maxStructuredDataSize`, defaulting to global max message size.
+- Store message structured-data length as `rs_size_t` instead of 16 bit.
+- Allocate parameter-value parse buffers from the actual SD length.
+- Preserve RFC3164/no-SD skip behavior and represent RFC5424 NILVALUE
+  as JSON null under the configured container.
+- Document RainerScript and YAML usage and add parameter reference pages.
+- Add focused regression tests for custom containers, NILVALUE, large SD,
+  oversized SD, and RFC3164 skip behavior.
+- Remove the old mmpstrucdata TSAN suppression and codify container
+  clean/rebuild guidance for local validation.
+
+Special credits:
+Bogoslovskii Fedor provided good analysis that facilitated parts of the
+implementation.
+
+Closes https://github.com/rsyslog/rsyslog/issues/3297
+Closes https://github.com/rsyslog/rsyslog/issues/1891
+
+With the help of AI-Agents: Codex
+
+Co-authored-by: Bogoslovskii Fedor <[email protected]>
+
+CVE: CVE-2026-61548
+Upstream-Status: Backport [https://github.com/rsyslog/rsyslog/commit/bcda60a3692efdf0c8e44102528f5a0ebe0dec6d]
+
+Backport Changes:
+- Limit this backport to parameter-buffer allocation and cleanup plus
+  cached structured-data length widening, which keeps the allocation
+  length valid for messages above 64 KiB.
+- Omit custom containers, the new structured-data size setting and
+  unrelated module changes from the broader feature commit, together
+  with its documentation, CI and test changes.
+
+Signed-off-by: Ashishkumar Parmar <[email protected]>
+---
+ plugins/mmpstrucdata/mmpstrucdata.c | 4 +++-
+ runtime/msg.h                       | 2 +-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/mmpstrucdata/mmpstrucdata.c b/plugins/mmpstrucdata/mmpstrucdata.c
+index 5228424..445fb8f 100644
+--- a/plugins/mmpstrucdata/mmpstrucdata.c
++++ b/plugins/mmpstrucdata/mmpstrucdata.c
+@@ -240,7 +240,7 @@ static rsRetVal ATTR_NONNULL()
+     parseSD_PARAM(instanceData *const pData, uchar *sdbuf, int lenbuf, int *curridx, struct json_object *jroot) {
+     int i;
+     uchar pName[33];
+-    uchar pVal[32 * 1024];
++    uchar *pVal = NULL;
+     struct json_object *jval;
+     DEFiRet;
+ 
+@@ -254,6 +254,7 @@ static rsRetVal ATTR_NONNULL()
+         ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD);
+     }
+     ++i;
++    CHKmalloc(pVal = malloc(lenbuf - i + 1));
+     CHKiRet(parsePARAM_VALUE(sdbuf, lenbuf, &i, pVal));
+     if (sdbuf[i] != '"') {
+         ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD);
+@@ -265,6 +266,7 @@ static rsRetVal ATTR_NONNULL()
+ 
+     *curridx = i;
+ finalize_it:
++    free(pVal);
+     RETiRet;
+ }
+ 
+diff --git a/runtime/msg.h b/runtime/msg.h
+index 9a66e88..0ed6efd 100644
+--- a/runtime/msg.h
++++ b/runtime/msg.h
+@@ -89,7 +89,7 @@ struct msg {
+         char *pszTIMESTAMP_MySQL; /* TIMESTAMP as MySQL formatted string (always 14 characters) */
+         char *pszTIMESTAMP_PgSQL; /* TIMESTAMP as PgSQL formatted string (always 21 characters) */
+         uchar *pszStrucData; /* STRUCTURED-DATA */
+-        uint16_t lenStrucData; /* (cached) length of STRUCTURED-DATA */
++        rs_size_t lenStrucData; /* (cached) length of STRUCTURED-DATA */
+         cstr_t *pCSAPPNAME; /* APP-NAME */
+         cstr_t *pCSPROCID; /* PROCID */
+         cstr_t *pCSMSGID; /* MSGID */
meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb +1 -0
index f132f4a764..23fa7b7146 100644
@@ -28,6 +28,7 @@ SRC_URI = "https://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \
            file://CVE-2026-19654.patch \
            file://CVE-2026-19654-regression.patch \
            file://CVE-2026-55556.patch \
+           file://CVE-2026-61548.patch \
 "
 
 SRC_URI:append:libc-musl = " \
Signature · 1 line
2.35.6