diff mbox series

[meta-oe,wrynose,1/2] rsyslog: Fix CVE-2026-55556

Message ID 20261124065638.3724216-1-asparmar@cisco.com
State New
Headers show
Series [meta-oe,wrynose,1/2] rsyslog: Fix CVE-2026-55556 | expand

Commit Message

From: Ashishkumar Parmar <asparmar@cisco.com>

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

Signed-off-by: Ashishkumar Parmar <asparmar@cisco.com>
---
 .../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
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-55556.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-55556.patch
new file mode 100644
index 0000000000..a950d58a50
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/CVE-2026-55556.patch
@@ -0,0 +1,72 @@ 
+From 8b9dbb6ddbc71fdbcd81e2b3b3d6f58dfde71adb Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <rgerhards@adiscon.com>
+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 <asparmar@cisco.com>
+---
+ 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);
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb
index 5ab4a65e67..f132f4a764 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2512.0.bb
@@ -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 = " \