REDHAT-BUG-2579185: Medium severity rsyslog Rsyslog vulnerability
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
#+beginsrc 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, rssizet pLen, unsigned short pbMustBeFreed, in else if (mode == SQLESCAPE) for (p = pp; p && p != '\'' && p != '\\'; ++p); else if (mode == JSONESCAPE) - 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! / #+endsrc
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in v8.23.0
Event History
Frequently Asked Questions
What conditions must be present for exploitation?
An attacker must be able to supply a field that the deployment inserts into a JSON string using an affected rsyslog string or list template with option.json="on". Whether this can be done remotely or without authentication depends on the configured input path.
What output is affected, and what is not affected?
The defect affects the option.json="on" string/list template path when a value consists entirely of double quotes and/or backslashes, which can produce malformed JSON. The separate property format="json" path was not affected in the reported control test.
What is the demonstrated impact?
Malformed JSON output was reproduced and rejected by a strict JSON parser. Injection, loss of neighboring records, whole-batch loss, and downstream batch dropping were not demonstrated.
How can I determine whether my deployment is exposed?
Review rsyslog templates that build JSON records and identify string or list templates using option.json="on" with attacker-influenced fields. Test whether a field containing only double quotes and/or backslashes produces output rejected by a strict JSON parser.