Bug 2579185 (CVE-2026-129839) - CVE-2026-129839 rsyslog: rsyslog: improper JSON escaping in option.json="on" template path for quote-only and backslash-only values
Summary: CVE-2026-129839 rsyslog: rsyslog: improper JSON escaping in option.json="on" ...
Keywords:
Status: NEW
Alias: CVE-2026-129839
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-20 16:55 UTC by OSIDB Bzimport
Modified: 2026-11-24 15:14 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-11-20 16:55:20 UTC
* subj: [vs-plain] rsyslog template JSON escaping defect cves: GHSA-cg8j-rwxh-vrg3    | CVE-2026-129839

Hello, We are coordinating GHSA-cg8j-rwxh-vrg3 under embargo until
Tuesday, 17 November 2026 at 16:00 UTC / 17:00 Europe/Berlin / 11:00
US Eastern. A value composed entirely of double quotes and/or
backslashes is not escaped by the option.json="on" string/list
template path. In runtime/template.c, the JSON precheck advances
through those special characters and returns early at the terminating
NUL. A JSON record built by the affected template can therefore be
malformed. We reproduced malformed output and rejection of that record
by a strict JSON parser. We have not demonstrated injection, loss of
neighboring records, whole-batch loss, or a particular downstream
service dropping a batch. The separate property format="json" path was
not affected in our control test. An attacker must be able to supply a
field that a deployment inserts into a JSON string through the
affected option.json template. Whether this is remote and
unauthenticated depends on the configured input path. Affected
upstream releases begin with v8.23.0, where commit
b0dc6c16f2d6dffc8947c1481cb70c8f63bd6d87 first appears. Severity is
Medium, CVSS 3.1 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N), CWE-116.
CVE requested; assignment pending. The one-line source fix changes the
JSON precheck to stop at either special character. The attached
source-only patch is from private PR #20 head
e422479031b4c389e99525d5077dcc2f214d9708, base
2ef6d8f5f0f3328437f5af7ccc1d0cc4a5746471. Patch SHA-256:
32e5deb04929d7c5d014cf8d5aa9cd0a9a4dbc93f02229a703ab8e8a93708c21.
Focused exact-byte regression, full local validation, hosted CI, and
fresh Codex code/security reviews passed on this head. The
fixed-version label is 2026-11-17 daily stable; actual tag and binary
package availability will be confirmed separately. We credit Manyo9
for the report. Please keep this information and patch embargoed until
the stated disclosure time. Regards, Rainer Gerhards rsyslog lead
maintainer


** Patch

#+begin_src diff
diff --git a/runtime/template.c b/runtime/template.c
index 14e38421d..7f0f4272b 100644
--- a/runtime/template.c
+++ b/runtime/template.c
@@ -1171,7 +1171,7 @@ rsRetVal doEscape(uchar **pp, rs_size_t *pLen, unsigned short *pbMustBeFreed, in
     else if (mode == SQL_ESCAPE)
         for (p = *pp; *p && *p != '\'' && *p != '\\'; ++p);
     else if (mode == JSON_ESCAPE)
-        for (p = *pp; *p && (*p == '"' || *p == '\\'); ++p);
+        for (p = *pp; *p && *p != '"' && *p != '\\'; ++p);
     /* when we get out of the loop, we are either at the
      * string terminator or the first character to escape */
     if (p && *p == '\0') FINALIZE; /* nothing to do in this case! */
#+end_src


Note You need to log in before you can comment on or make changes to this bug.